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: Fileset.html 828297 2012-08-07 22:03:07Z hboutemy $
33 * @since 2.1
34 */
35 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 public File getDirectory()
47 {
48 return directory;
49 }
50
51 public String[] getIncludes()
52 {
53 return ( includes != null ) ? includes : new String[0];
54 }
55
56 public String[] getExcludes()
57 {
58 return ( excludes != null ) ? excludes : new String[0];
59 }
60
61 public boolean isFollowSymlinks()
62 {
63 return followSymlinks;
64 }
65
66 /**
67 * Retrieves the included and excluded files from this file-set's directory.
68 * Specifically, <code>"file-set: <I>[directory]</I> (included:
69 * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
70 *
71 * @return The included and excluded files from this file-set's directory.
72 * Specifically, <code>"file-set: <I>[directory]</I> (included:
73 * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
74 * @see java.lang.Object#toString()
75 */
76 public String toString()
77 {
78 return "file set: " + getDirectory() + " (included: " + Arrays.asList( getIncludes() ) + ", excluded: "
79 + Arrays.asList( getExcludes() ) + ")";
80 }
81
82 }