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