Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
SetBase |
|
| 1.5555555555555556;1,556 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugin.assembly.model; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * Class SetBase. | |
15 | * | |
16 | * @version $Revision$ $Date$ | |
17 | */ | |
18 | 204 | public class SetBase |
19 | implements java.io.Serializable | |
20 | { | |
21 | ||
22 | //--------------------------/ | |
23 | //- Class/Member Variables -/ | |
24 | //--------------------------/ | |
25 | ||
26 | /** | |
27 | * | |
28 | * When specified as true, any include/exclude | |
29 | * patterns which aren't used to filter an actual | |
30 | * artifact during assembly creation will cause the | |
31 | * build to fail with an error. This is meant | |
32 | * to highlight obsolete inclusions or exclusions, or | |
33 | * else signal that the assembly descriptor | |
34 | * is incorrectly configured. | |
35 | * | |
36 | */ | |
37 | 204 | private boolean useStrictFiltering = false; |
38 | ||
39 | /** | |
40 | * | |
41 | * Whether standard exclusion patterns, such as | |
42 | * those matching CVS and Subversion | |
43 | * metadata files, should be used when calculating | |
44 | * the files affected by this set. | |
45 | * For backward compatibility, the default value is | |
46 | * true. | |
47 | * | |
48 | */ | |
49 | 204 | private boolean useDefaultExcludes = true; |
50 | ||
51 | /** | |
52 | * | |
53 | * Sets the output directory relative to the root | |
54 | * of the root directory of the assembly. For | |
55 | * example, | |
56 | * "log" will put the specified files in the log | |
57 | * directory. | |
58 | * | |
59 | */ | |
60 | private String outputDirectory; | |
61 | ||
62 | /** | |
63 | * Field includes. | |
64 | */ | |
65 | private java.util.List/*<String>*/ includes; | |
66 | ||
67 | /** | |
68 | * Field excludes. | |
69 | */ | |
70 | private java.util.List/*<String>*/ excludes; | |
71 | ||
72 | /** | |
73 | * | |
74 | * | |
75 | * Similar to a UNIX permission, sets the file mode | |
76 | * of the files included. | |
77 | * Format: (User)(Group)(Other) where each | |
78 | * component is a sum of Read = 4, | |
79 | * Write = 2, and Execute = 1. For example, the | |
80 | * value 0644 | |
81 | * translates to User read-write, Group and Other | |
82 | * read-only. | |
83 | * <a | |
84 | * href="http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html">(more | |
85 | * on unix-style permissions)</a> | |
86 | * | |
87 | * | |
88 | */ | |
89 | private String fileMode; | |
90 | ||
91 | /** | |
92 | * | |
93 | * | |
94 | * Similar to a UNIX permission, sets the directory | |
95 | * mode of the directories | |
96 | * included. Format: (User)(Group)(Other) where | |
97 | * each component is a sum of | |
98 | * Read = 4, Write = 2, and Execute = 1. For | |
99 | * example, the value | |
100 | * 0755 translates to User read-write, Group and | |
101 | * Other read-only. | |
102 | * <a | |
103 | * href="http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html">(more | |
104 | * on unix-style permissions)</a> | |
105 | * | |
106 | * | |
107 | */ | |
108 | private String directoryMode; | |
109 | ||
110 | ||
111 | //-----------/ | |
112 | //- Methods -/ | |
113 | //-----------/ | |
114 | ||
115 | /** | |
116 | * Method addExclude. | |
117 | * | |
118 | * @param string | |
119 | */ | |
120 | public void addExclude( String string ) | |
121 | { | |
122 | 6 | if ( !(string instanceof String) ) |
123 | { | |
124 | 0 | throw new ClassCastException( "SetBase.addExcludes(string) parameter must be instanceof " + String.class.getName() ); |
125 | } | |
126 | 6 | getExcludes().add( string ); |
127 | 6 | } //-- void addExclude( String ) |
128 | ||
129 | /** | |
130 | * Method addInclude. | |
131 | * | |
132 | * @param string | |
133 | */ | |
134 | public void addInclude( String string ) | |
135 | { | |
136 | 12 | if ( !(string instanceof String) ) |
137 | { | |
138 | 0 | throw new ClassCastException( "SetBase.addIncludes(string) parameter must be instanceof " + String.class.getName() ); |
139 | } | |
140 | 12 | getIncludes().add( string ); |
141 | 12 | } //-- void addInclude( String ) |
142 | ||
143 | /** | |
144 | * Get | |
145 | * | |
146 | * Similar to a UNIX permission, sets the directory | |
147 | * mode of the directories | |
148 | * included. Format: (User)(Group)(Other) where | |
149 | * each component is a sum of | |
150 | * Read = 4, Write = 2, and Execute = 1. For | |
151 | * example, the value | |
152 | * 0755 translates to User read-write, Group and | |
153 | * Other read-only. | |
154 | * <a | |
155 | * href="http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html">(more | |
156 | * on unix-style permissions)</a> | |
157 | * | |
158 | * | |
159 | * | |
160 | * @return String | |
161 | */ | |
162 | public String getDirectoryMode() | |
163 | { | |
164 | 114 | return this.directoryMode; |
165 | } //-- String getDirectoryMode() | |
166 | ||
167 | /** | |
168 | * Method getExcludes. | |
169 | * | |
170 | * @return List | |
171 | */ | |
172 | public java.util.List/*<String>*/ getExcludes() | |
173 | { | |
174 | 216 | if ( this.excludes == null ) |
175 | { | |
176 | 96 | this.excludes = new java.util.ArrayList/*<String>*/(); |
177 | } | |
178 | ||
179 | 216 | return this.excludes; |
180 | } //-- java.util.List/*<String>*/ getExcludes() | |
181 | ||
182 | /** | |
183 | * Get | |
184 | * | |
185 | * Similar to a UNIX permission, sets the file mode | |
186 | * of the files included. | |
187 | * Format: (User)(Group)(Other) where each | |
188 | * component is a sum of Read = 4, | |
189 | * Write = 2, and Execute = 1. For example, the | |
190 | * value 0644 | |
191 | * translates to User read-write, Group and Other | |
192 | * read-only. | |
193 | * <a | |
194 | * href="http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html">(more | |
195 | * on unix-style permissions)</a> | |
196 | * | |
197 | * | |
198 | * | |
199 | * @return String | |
200 | */ | |
201 | public String getFileMode() | |
202 | { | |
203 | 114 | return this.fileMode; |
204 | } //-- String getFileMode() | |
205 | ||
206 | /** | |
207 | * Method getIncludes. | |
208 | * | |
209 | * @return List | |
210 | */ | |
211 | public java.util.List/*<String>*/ getIncludes() | |
212 | { | |
213 | 250 | if ( this.includes == null ) |
214 | { | |
215 | 84 | this.includes = new java.util.ArrayList/*<String>*/(); |
216 | } | |
217 | ||
218 | 250 | return this.includes; |
219 | } //-- java.util.List/*<String>*/ getIncludes() | |
220 | ||
221 | /** | |
222 | * Get | |
223 | * Sets the output directory relative to the root | |
224 | * of the root directory of the assembly. For | |
225 | * example, | |
226 | * "log" will put the specified files in the log | |
227 | * directory. | |
228 | * | |
229 | * | |
230 | * @return String | |
231 | */ | |
232 | public String getOutputDirectory() | |
233 | { | |
234 | 206 | return this.outputDirectory; |
235 | } //-- String getOutputDirectory() | |
236 | ||
237 | /** | |
238 | * Get | |
239 | * Whether standard exclusion patterns, such as | |
240 | * those matching CVS and Subversion | |
241 | * metadata files, should be used when calculating | |
242 | * the files affected by this set. | |
243 | * For backward compatibility, the default value is | |
244 | * true. | |
245 | * | |
246 | * | |
247 | * @return boolean | |
248 | */ | |
249 | public boolean isUseDefaultExcludes() | |
250 | { | |
251 | 82 | return this.useDefaultExcludes; |
252 | } //-- boolean isUseDefaultExcludes() | |
253 | ||
254 | /** | |
255 | * Get | |
256 | * When specified as true, any include/exclude | |
257 | * patterns which aren't used to filter an actual | |
258 | * artifact during assembly creation will cause the | |
259 | * build to fail with an error. This is meant | |
260 | * to highlight obsolete inclusions or exclusions, or | |
261 | * else signal that the assembly descriptor | |
262 | * is incorrectly configured. | |
263 | * | |
264 | * | |
265 | * @return boolean | |
266 | */ | |
267 | public boolean isUseStrictFiltering() | |
268 | { | |
269 | 92 | return this.useStrictFiltering; |
270 | } //-- boolean isUseStrictFiltering() | |
271 | ||
272 | /** | |
273 | * Method removeExclude. | |
274 | * | |
275 | * @param string | |
276 | */ | |
277 | public void removeExclude( String string ) | |
278 | { | |
279 | 0 | if ( !(string instanceof String) ) |
280 | { | |
281 | 0 | throw new ClassCastException( "SetBase.removeExcludes(string) parameter must be instanceof " + String.class.getName() ); |
282 | } | |
283 | 0 | getExcludes().remove( string ); |
284 | 0 | } //-- void removeExclude( String ) |
285 | ||
286 | /** | |
287 | * Method removeInclude. | |
288 | * | |
289 | * @param string | |
290 | */ | |
291 | public void removeInclude( String string ) | |
292 | { | |
293 | 0 | if ( !(string instanceof String) ) |
294 | { | |
295 | 0 | throw new ClassCastException( "SetBase.removeIncludes(string) parameter must be instanceof " + String.class.getName() ); |
296 | } | |
297 | 0 | getIncludes().remove( string ); |
298 | 0 | } //-- void removeInclude( String ) |
299 | ||
300 | /** | |
301 | * Set | |
302 | * | |
303 | * Similar to a UNIX permission, sets the directory | |
304 | * mode of the directories | |
305 | * included. Format: (User)(Group)(Other) where | |
306 | * each component is a sum of | |
307 | * Read = 4, Write = 2, and Execute = 1. For | |
308 | * example, the value | |
309 | * 0755 translates to User read-write, Group and | |
310 | * Other read-only. | |
311 | * <a | |
312 | * href="http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html">(more | |
313 | * on unix-style permissions)</a> | |
314 | * | |
315 | * | |
316 | * | |
317 | * @param directoryMode | |
318 | */ | |
319 | public void setDirectoryMode( String directoryMode ) | |
320 | { | |
321 | 26 | this.directoryMode = directoryMode; |
322 | 26 | } //-- void setDirectoryMode( String ) |
323 | ||
324 | /** | |
325 | * Set | |
326 | * | |
327 | * When <exclude> subelements are present, | |
328 | * they define a set of | |
329 | * files and directory to exclude. If none is | |
330 | * present, then | |
331 | * <excludes> represents no exclusions. | |
332 | * | |
333 | * | |
334 | * | |
335 | * @param excludes | |
336 | */ | |
337 | public void setExcludes( java.util.List/*<String>*/ excludes ) | |
338 | { | |
339 | 12 | this.excludes = excludes; |
340 | 12 | } //-- void setExcludes( java.util.List ) |
341 | ||
342 | /** | |
343 | * Set | |
344 | * | |
345 | * Similar to a UNIX permission, sets the file mode | |
346 | * of the files included. | |
347 | * Format: (User)(Group)(Other) where each | |
348 | * component is a sum of Read = 4, | |
349 | * Write = 2, and Execute = 1. For example, the | |
350 | * value 0644 | |
351 | * translates to User read-write, Group and Other | |
352 | * read-only. | |
353 | * <a | |
354 | * href="http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html">(more | |
355 | * on unix-style permissions)</a> | |
356 | * | |
357 | * | |
358 | * | |
359 | * @param fileMode | |
360 | */ | |
361 | public void setFileMode( String fileMode ) | |
362 | { | |
363 | 46 | this.fileMode = fileMode; |
364 | 46 | } //-- void setFileMode( String ) |
365 | ||
366 | /** | |
367 | * Set | |
368 | * | |
369 | * When <include> subelements are present, | |
370 | * they define a set of | |
371 | * files and directory to include. If none is | |
372 | * present, then | |
373 | * <includes> represents all valid values. | |
374 | * | |
375 | * | |
376 | * | |
377 | * @param includes | |
378 | */ | |
379 | public void setIncludes( java.util.List/*<String>*/ includes ) | |
380 | { | |
381 | 26 | this.includes = includes; |
382 | 26 | } //-- void setIncludes( java.util.List ) |
383 | ||
384 | /** | |
385 | * Set | |
386 | * Sets the output directory relative to the root | |
387 | * of the root directory of the assembly. For | |
388 | * example, | |
389 | * "log" will put the specified files in the log | |
390 | * directory. | |
391 | * | |
392 | * | |
393 | * @param outputDirectory | |
394 | */ | |
395 | public void setOutputDirectory( String outputDirectory ) | |
396 | { | |
397 | 78 | this.outputDirectory = outputDirectory; |
398 | 78 | } //-- void setOutputDirectory( String ) |
399 | ||
400 | /** | |
401 | * Set | |
402 | * Whether standard exclusion patterns, such as | |
403 | * those matching CVS and Subversion | |
404 | * metadata files, should be used when calculating | |
405 | * the files affected by this set. | |
406 | * For backward compatibility, the default value is | |
407 | * true. | |
408 | * | |
409 | * | |
410 | * @param useDefaultExcludes | |
411 | */ | |
412 | public void setUseDefaultExcludes( boolean useDefaultExcludes ) | |
413 | { | |
414 | 4 | this.useDefaultExcludes = useDefaultExcludes; |
415 | 4 | } //-- void setUseDefaultExcludes( boolean ) |
416 | ||
417 | /** | |
418 | * Set | |
419 | * When specified as true, any include/exclude | |
420 | * patterns which aren't used to filter an actual | |
421 | * artifact during assembly creation will cause the | |
422 | * build to fail with an error. This is meant | |
423 | * to highlight obsolete inclusions or exclusions, or | |
424 | * else signal that the assembly descriptor | |
425 | * is incorrectly configured. | |
426 | * | |
427 | * | |
428 | * @param useStrictFiltering | |
429 | */ | |
430 | public void setUseStrictFiltering( boolean useStrictFiltering ) | |
431 | { | |
432 | 0 | this.useStrictFiltering = useStrictFiltering; |
433 | 0 | } //-- void setUseStrictFiltering( boolean ) |
434 | ||
435 | ||
436 | } |