2011/08/05 - Jakarta Cactus has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.cactus.eclipse.runner.ui;
22
23 import java.util.Hashtable;
24
25 import org.eclipse.jface.preference.IPreferenceStore;
26
27
28
29
30
31
32 public class CactusPreferences
33 {
34
35
36
37
38 public static final String CONTEXT_URL_SCHEME = "contextURL_Scheme";
39
40
41
42
43 public static final String CONTEXT_URL_HOST = "contextURL_Host";
44
45
46
47
48 public static final String CONTEXT_URL_PORT = "contextURL_Port";
49
50
51
52
53 public static final String CONTEXT_URL_PATH = "contextURL_Path";
54
55
56
57
58 public static final String TEMP_DIR = "temp_Dir";
59
60
61
62
63 public static final String JETTY = "jetty";
64
65
66
67
68 public static final String JETTY_XML = "jetty_xml";
69
70
71
72
73
74 public static String getContextURL()
75 {
76 IPreferenceStore store = CactusPlugin.getDefault().getPreferenceStore();
77 StringBuffer buf =
78 new StringBuffer()
79 .append(store.getString(CONTEXT_URL_SCHEME))
80 .append("://")
81 .append(store.getString(CONTEXT_URL_HOST))
82 .append(":")
83 .append(store.getInt(CONTEXT_URL_PORT))
84 .append("/")
85 .append(store.getString(CONTEXT_URL_PATH));
86 String result = buf.toString();
87 return result;
88 }
89
90
91
92
93
94 public static int getContextURLPort()
95 {
96 IPreferenceStore store = CactusPlugin.getDefault().getPreferenceStore();
97 int result = store.getInt(CONTEXT_URL_PORT);
98 return result;
99 }
100
101
102
103
104
105 public static String getContextURLPath()
106 {
107 IPreferenceStore store = CactusPlugin.getDefault().getPreferenceStore();
108 String result = store.getString(CONTEXT_URL_PATH);
109 return result;
110 }
111
112
113
114
115
116 public static String getTempDir()
117 {
118 IPreferenceStore store = CactusPlugin.getDefault().getPreferenceStore();
119 String result = store.getString(TEMP_DIR);
120 return result;
121 }
122
123
124
125
126
127 public static String getContainerDir(String theContainerId)
128 {
129 IPreferenceStore store = CactusPlugin.getDefault().getPreferenceStore();
130 String result = store.getString(theContainerId);
131 return result;
132 }
133
134
135
136
137 public static boolean getJetty()
138 {
139 IPreferenceStore store = CactusPlugin.getDefault().getPreferenceStore();
140 boolean result = store.getBoolean(JETTY);
141 return result;
142 }
143
144
145
146
147 public static String getJettyXML()
148 {
149 IPreferenceStore store = CactusPlugin.getDefault().getPreferenceStore();
150 String result = store.getString(JETTY_XML);
151 return result;
152 }
153
154
155
156
157 public static Hashtable getContainerHomes()
158 {
159 Hashtable containerHomes = new Hashtable();
160 String[] containerIds = CactusPlugin.getContainerIds();
161
162 for (int i = 0; i < containerIds.length; i++)
163 {
164 String currentId = containerIds[i];
165 String currentContainerDir = getContainerDir(currentId);
166 if (!currentContainerDir.equals(""))
167 {
168 containerHomes.put(currentId, currentContainerDir);
169 }
170
171 }
172 return containerHomes;
173 }
174 }