Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Fileset |
|
| 1.3333333333333333;1,333 |
1 | package org.apache.maven.plugin.clean; | |
2 | ||
3 | /* | |
4 | * Licensed to the Apache Software Foundation (ASF) under one | |
5 | * or more contributor license agreements. See the NOTICE file | |
6 | * distributed with this work for additional information | |
7 | * regarding copyright ownership. The ASF licenses this file | |
8 | * to you under the Apache License, Version 2.0 (the | |
9 | * "License"); you may not use this file except in compliance | |
10 | * with the License. You may obtain a copy of the License at | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
14 | * Unless required by applicable law or agreed to in writing, | |
15 | * software distributed under the License is distributed on an | |
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
17 | * KIND, either express or implied. See the License for the | |
18 | * specific language governing permissions and limitations | |
19 | * under the License. | |
20 | */ | |
21 | ||
22 | import java.io.File; | |
23 | import java.util.Arrays; | |
24 | ||
25 | /** | |
26 | * Customizes the string representation of | |
27 | * <code>org.apache.maven.shared.model.fileset.FileSet</code> to return the | |
28 | * included and excluded files from the file-set's directory. Specifically, | |
29 | * <code>"file-set: <I>[directory]</I> (included: <I>[included files]</I>, | |
30 | * excluded: <I>[excluded files]</I>)"</code> | |
31 | * | |
32 | * @version $Id$ | |
33 | * @since 2.1 | |
34 | */ | |
35 | 2 | public class Fileset |
36 | { | |
37 | ||
38 | private File directory; | |
39 | ||
40 | private String[] includes; | |
41 | ||
42 | private String[] excludes; | |
43 | ||
44 | private boolean followSymlinks; | |
45 | ||
46 | private boolean useDefaultExcludes; | |
47 | ||
48 | public File getDirectory() | |
49 | { | |
50 | 4 | return directory; |
51 | } | |
52 | ||
53 | public String[] getIncludes() | |
54 | { | |
55 | 2 | return ( includes != null ) ? includes : new String[0]; |
56 | } | |
57 | ||
58 | public String[] getExcludes() | |
59 | { | |
60 | 2 | return ( excludes != null ) ? excludes : new String[0]; |
61 | } | |
62 | ||
63 | public boolean isFollowSymlinks() | |
64 | { | |
65 | 2 | return followSymlinks; |
66 | } | |
67 | ||
68 | public boolean isUseDefaultExcludes() | |
69 | { | |
70 | 2 | return useDefaultExcludes; |
71 | } | |
72 | ||
73 | /** | |
74 | * Retrieves the included and excluded files from this file-set's directory. | |
75 | * Specifically, <code>"file-set: <I>[directory]</I> (included: | |
76 | * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code> | |
77 | * | |
78 | * @return The included and excluded files from this file-set's directory. | |
79 | * Specifically, <code>"file-set: <I>[directory]</I> (included: | |
80 | * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code> | |
81 | * @see java.lang.Object#toString() | |
82 | */ | |
83 | public String toString() | |
84 | { | |
85 | 0 | return "file set: " + getDirectory() + " (included: " + Arrays.asList( getIncludes() ) + ", excluded: " |
86 | + Arrays.asList( getExcludes() ) + ")"; | |
87 | } | |
88 | ||
89 | } |