Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Proxy |
|
| 1.0;1 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.settings; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * | |
15 | * | |
16 | * The <code><proxy></code> element contains | |
17 | * informations required to a proxy settings. | |
18 | * | |
19 | * | |
20 | * @version $Revision$ $Date$ | |
21 | */ | |
22 | 0 | public class Proxy extends IdentifiableBase |
23 | implements java.io.Serializable | |
24 | { | |
25 | ||
26 | ||
27 | //--------------------------/ | |
28 | //- Class/Member Variables -/ | |
29 | //--------------------------/ | |
30 | ||
31 | /** | |
32 | * | |
33 | * | |
34 | * Whether this proxy configuration is the active | |
35 | * one. | |
36 | * | |
37 | * | |
38 | */ | |
39 | 0 | private boolean active = true; |
40 | ||
41 | /** | |
42 | * | |
43 | * | |
44 | * The proxy protocol. | |
45 | * | |
46 | * | |
47 | */ | |
48 | 0 | private String protocol = "http"; |
49 | ||
50 | /** | |
51 | * | |
52 | * | |
53 | * The proxy user. | |
54 | * | |
55 | * | |
56 | */ | |
57 | private String username; | |
58 | ||
59 | /** | |
60 | * | |
61 | * | |
62 | * The proxy password. | |
63 | * | |
64 | * | |
65 | */ | |
66 | private String password; | |
67 | ||
68 | /** | |
69 | * | |
70 | * | |
71 | * The proxy port. | |
72 | * | |
73 | * | |
74 | */ | |
75 | 0 | private int port = 8080; |
76 | ||
77 | /** | |
78 | * | |
79 | * | |
80 | * The proxy host. | |
81 | * | |
82 | * | |
83 | */ | |
84 | private String host; | |
85 | ||
86 | /** | |
87 | * | |
88 | * | |
89 | * The list of non-proxied hosts (delimited by |). | |
90 | * | |
91 | * | |
92 | */ | |
93 | private String nonProxyHosts; | |
94 | ||
95 | ||
96 | //-----------/ | |
97 | //- Methods -/ | |
98 | //-----------/ | |
99 | ||
100 | /** | |
101 | * Get | |
102 | * | |
103 | * The proxy host. | |
104 | * | |
105 | * | |
106 | * | |
107 | * @return String | |
108 | */ | |
109 | public String getHost() | |
110 | { | |
111 | 0 | return this.host; |
112 | } //-- String getHost() | |
113 | ||
114 | /** | |
115 | * Get | |
116 | * | |
117 | * The list of non-proxied hosts (delimited by |). | |
118 | * | |
119 | * | |
120 | * | |
121 | * @return String | |
122 | */ | |
123 | public String getNonProxyHosts() | |
124 | { | |
125 | 0 | return this.nonProxyHosts; |
126 | } //-- String getNonProxyHosts() | |
127 | ||
128 | /** | |
129 | * Get | |
130 | * | |
131 | * The proxy password. | |
132 | * | |
133 | * | |
134 | * | |
135 | * @return String | |
136 | */ | |
137 | public String getPassword() | |
138 | { | |
139 | 0 | return this.password; |
140 | } //-- String getPassword() | |
141 | ||
142 | /** | |
143 | * Get | |
144 | * | |
145 | * The proxy port. | |
146 | * | |
147 | * | |
148 | * | |
149 | * @return int | |
150 | */ | |
151 | public int getPort() | |
152 | { | |
153 | 0 | return this.port; |
154 | } //-- int getPort() | |
155 | ||
156 | /** | |
157 | * Get | |
158 | * | |
159 | * The proxy protocol. | |
160 | * | |
161 | * | |
162 | * | |
163 | * @return String | |
164 | */ | |
165 | public String getProtocol() | |
166 | { | |
167 | 0 | return this.protocol; |
168 | } //-- String getProtocol() | |
169 | ||
170 | /** | |
171 | * Get | |
172 | * | |
173 | * The proxy user. | |
174 | * | |
175 | * | |
176 | * | |
177 | * @return String | |
178 | */ | |
179 | public String getUsername() | |
180 | { | |
181 | 0 | return this.username; |
182 | } //-- String getUsername() | |
183 | ||
184 | /** | |
185 | * Get | |
186 | * | |
187 | * Whether this proxy configuration is the active | |
188 | * one. | |
189 | * | |
190 | * | |
191 | * | |
192 | * @return boolean | |
193 | */ | |
194 | public boolean isActive() | |
195 | { | |
196 | 0 | return this.active; |
197 | } //-- boolean isActive() | |
198 | ||
199 | /** | |
200 | * Set | |
201 | * | |
202 | * Whether this proxy configuration is the active | |
203 | * one. | |
204 | * | |
205 | * | |
206 | * | |
207 | * @param active | |
208 | */ | |
209 | public void setActive( boolean active ) | |
210 | { | |
211 | 0 | this.active = active; |
212 | 0 | } //-- void setActive( boolean ) |
213 | ||
214 | /** | |
215 | * Set | |
216 | * | |
217 | * The proxy host. | |
218 | * | |
219 | * | |
220 | * | |
221 | * @param host | |
222 | */ | |
223 | public void setHost( String host ) | |
224 | { | |
225 | 0 | this.host = host; |
226 | 0 | } //-- void setHost( String ) |
227 | ||
228 | /** | |
229 | * Set | |
230 | * | |
231 | * The list of non-proxied hosts (delimited by |). | |
232 | * | |
233 | * | |
234 | * | |
235 | * @param nonProxyHosts | |
236 | */ | |
237 | public void setNonProxyHosts( String nonProxyHosts ) | |
238 | { | |
239 | 0 | this.nonProxyHosts = nonProxyHosts; |
240 | 0 | } //-- void setNonProxyHosts( String ) |
241 | ||
242 | /** | |
243 | * Set | |
244 | * | |
245 | * The proxy password. | |
246 | * | |
247 | * | |
248 | * | |
249 | * @param password | |
250 | */ | |
251 | public void setPassword( String password ) | |
252 | { | |
253 | 0 | this.password = password; |
254 | 0 | } //-- void setPassword( String ) |
255 | ||
256 | /** | |
257 | * Set | |
258 | * | |
259 | * The proxy port. | |
260 | * | |
261 | * | |
262 | * | |
263 | * @param port | |
264 | */ | |
265 | public void setPort( int port ) | |
266 | { | |
267 | 0 | this.port = port; |
268 | 0 | } //-- void setPort( int ) |
269 | ||
270 | /** | |
271 | * Set | |
272 | * | |
273 | * The proxy protocol. | |
274 | * | |
275 | * | |
276 | * | |
277 | * @param protocol | |
278 | */ | |
279 | public void setProtocol( String protocol ) | |
280 | { | |
281 | 0 | this.protocol = protocol; |
282 | 0 | } //-- void setProtocol( String ) |
283 | ||
284 | /** | |
285 | * Set | |
286 | * | |
287 | * The proxy user. | |
288 | * | |
289 | * | |
290 | * | |
291 | * @param username | |
292 | */ | |
293 | public void setUsername( String username ) | |
294 | { | |
295 | 0 | this.username = username; |
296 | 0 | } //-- void setUsername( String ) |
297 | ||
298 | ||
299 | 0 | private String modelEncoding = "UTF-8"; |
300 | ||
301 | /** | |
302 | * Set an encoding used for reading/writing the model. | |
303 | * | |
304 | * @param modelEncoding the encoding used when reading/writing the model. | |
305 | */ | |
306 | public void setModelEncoding( String modelEncoding ) | |
307 | { | |
308 | 0 | this.modelEncoding = modelEncoding; |
309 | 0 | } |
310 | ||
311 | /** | |
312 | * @return the current encoding used when reading/writing this model. | |
313 | */ | |
314 | public String getModelEncoding() | |
315 | { | |
316 | 0 | return modelEncoding; |
317 | } | |
318 | } |