View Javadoc

1   /**
2    * Copyright 2008-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.codehaus.mojo.wagon.shared;
17  
18  import java.io.File;
19  
20  /**
21   * Wagon configuration to scan for a set of remote files.
22   */
23  public class WagonFileSet {
24  
25      /**
26       * Path after the url, this is where the scan starts
27       */
28      private String directory = "";
29  
30      /**
31       * Ant's excludes path expression
32       */
33      private String[] excludes;
34  
35      /**
36       * Ant's includes path expression
37       */
38      private String[] includes;
39  
40      /**
41       *
42       */
43      private boolean caseSensitive;
44  
45      /**
46       * User default exclude sets
47       */
48      private boolean useDefaultExcludes = true;
49  
50      /**
51       * Local path to download the remote files to
52       */
53      private File downloadDirectory;
54  
55      /**
56       * Relative to the remote URL. Used to copy files between 2 URLs.
57       */
58      private String outputDirectory = "";
59  
60      public String getDirectory() {
61          return directory;
62      }
63  
64      public void setDirectory(String remotePath) {
65          this.directory = remotePath;
66      }
67  
68      public File getDownloadDirectory() {
69          return downloadDirectory;
70      }
71  
72      public void setDownloadDirectory(File downloadDirectory) {
73          this.downloadDirectory = downloadDirectory;
74      }
75  
76      public String[] getExcludes() {
77          return excludes;
78      }
79  
80      public void setExcludes(String[] excludes) {
81          this.excludes = excludes;
82      }
83  
84      public String[] getIncludes() {
85          return includes;
86      }
87  
88      public void setIncludes(String[] includes) {
89          this.includes = includes;
90      }
91  
92      public boolean isCaseSensitive() {
93          return caseSensitive;
94      }
95  
96      public void setCaseSensitive(boolean caseSensitive) {
97          this.caseSensitive = caseSensitive;
98      }
99  
100     /**
101      * Retrieves the included and excluded files from this file-set's directory. Specifically,
102      * <code>"file-set: <I>[directory]</I> (included:
103      * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
104      *
105      * @return The included and excluded files from this file-set's directory. Specifically,
106      *         <code>"file-set: <I>[directory]</I> (included:
107      * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
108      * @see java.lang.Object#toString()
109      */
110     @Override
111     public String toString() {
112         return "file-set: " + getDirectory() + " (included: " + getIncludes() + ", excluded: " + getExcludes() + ")";
113     }
114 
115     public boolean isUseDefaultExcludes() {
116         return useDefaultExcludes;
117     }
118 
119     public void setUseDefaultExcludes(boolean useDefaultExcludes) {
120         this.useDefaultExcludes = useDefaultExcludes;
121     }
122 
123     public String getOutputDirectory() {
124         return outputDirectory;
125     }
126 
127     public void setOutputDirectory(String outputDirectory) {
128         this.outputDirectory = outputDirectory;
129     }
130 
131 }