View Javadoc

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