View Javadoc
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   * @version $Id: Fileset.java 1705442 2015-09-26 12:30:18Z khmarbaise $
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      private boolean useDefaultExcludes;
47  
48      /**
49       * @return {@link #directory}
50       */
51      public File getDirectory()
52      {
53          return directory;
54      }
55  
56      /**
57       * @return {@link #includes}
58       */
59      public String[] getIncludes()
60      {
61          return ( includes != null ) ? includes : new String[0];
62      }
63  
64      /**
65       * @return {@link #excludes}
66       */
67      public String[] getExcludes()
68      {
69          return ( excludes != null ) ? excludes : new String[0];
70      }
71  
72      /**
73       * @return {@link #followSymlinks}
74       */
75      public boolean isFollowSymlinks()
76      {
77          return followSymlinks;
78      }
79  
80      /**
81       * @return {@link #useDefaultExcludes}
82       */
83      public boolean isUseDefaultExcludes()
84      {
85          return useDefaultExcludes;
86      }
87  
88      /**
89       * Retrieves the included and excluded files from this file-set's directory.
90       * Specifically, <code>"file-set: <I>[directory]</I> (included:
91       * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
92       *
93       * @return The included and excluded files from this file-set's directory.
94       * Specifically, <code>"file-set: <I>[directory]</I> (included:
95       * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
96       * @see java.lang.Object#toString()
97       */
98      public String toString()
99      {
100         return "file set: " + getDirectory() + " (included: " + Arrays.asList( getIncludes() ) + ", excluded: "
101             + Arrays.asList( getExcludes() ) + ")";
102     }
103 
104 }