1 package org.apache.maven.plugins.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 * @since 2.1
33 */
34 public class Fileset
35 {
36
37 private File directory;
38
39 private String[] includes;
40
41 private String[] excludes;
42
43 private boolean followSymlinks;
44
45 private boolean useDefaultExcludes;
46
47 /**
48 * @return {@link #directory}
49 */
50 public File getDirectory()
51 {
52 return directory;
53 }
54
55 /**
56 * @return {@link #includes}
57 */
58 public String[] getIncludes()
59 {
60 return ( includes != null ) ? includes : new String[0];
61 }
62
63 /**
64 * @return {@link #excludes}
65 */
66 public String[] getExcludes()
67 {
68 return ( excludes != null ) ? excludes : new String[0];
69 }
70
71 /**
72 * @return {@link #followSymlinks}
73 */
74 public boolean isFollowSymlinks()
75 {
76 return followSymlinks;
77 }
78
79 /**
80 * @return {@link #useDefaultExcludes}
81 */
82 public boolean isUseDefaultExcludes()
83 {
84 return useDefaultExcludes;
85 }
86
87 /**
88 * Retrieves the included and excluded files from this file-set's directory.
89 * Specifically, <code>"file-set: <I>[directory]</I> (included:
90 * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
91 *
92 * @return The included and excluded files from this file-set's directory.
93 * Specifically, <code>"file-set: <I>[directory]</I> (included:
94 * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
95 * @see java.lang.Object#toString()
96 */
97 public String toString()
98 {
99 return "file set: " + getDirectory() + " (included: " + Arrays.asList( getIncludes() ) + ", excluded: "
100 + Arrays.asList( getExcludes() ) + ")";
101 }
102
103 }