1 package org.codehaus.mojo.wagon.shared;
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 * Wagon configuration to scan for a set of remote files.
27 */
28 public class WagonFileSet
29 {
30 /**
31 * Path after the url, this is where the scan starts
32 */
33
34 private String directory = "";
35
36 /**
37 * Ant's excludes path expression
38 */
39 private String[] excludes;
40
41 /**
42 * Ant's includes path expression
43 */
44 private String[] includes;
45
46 /**
47 *
48 */
49 private boolean caseSensitive;
50
51 /**
52 * User default exclude sets
53 */
54 private boolean useDefaultExcludes = true;
55
56 /**
57 * Local path to download the remote resource ( tree ) to.
58 */
59 private File downloadDirectory;
60
61 /**
62 * Relative of a remote URL when it used to copy files between 2 URLs.
63 */
64 private String outputDirectory = "";
65
66 // ////////////////////////////////////////////////////////////////////////////////////
67
68 public String getDirectory()
69 {
70 return directory;
71 }
72
73 public void setDirectory( String remotePath )
74 {
75 this.directory = remotePath;
76 }
77
78 public File getDownloadDirectory()
79 {
80 return downloadDirectory;
81 }
82
83 public void setDownloadDirectory( File downloadDirectory )
84 {
85 this.downloadDirectory = downloadDirectory;
86 }
87
88 public String[] getExcludes()
89 {
90 return excludes;
91 }
92
93 public void setExcludes( String[] excludes )
94 {
95 this.excludes = excludes;
96 }
97
98 public String[] getIncludes()
99 {
100 return includes;
101 }
102
103 public void setIncludes( String[] includes )
104 {
105 this.includes = includes;
106 }
107
108 public boolean isCaseSensitive()
109 {
110 return caseSensitive;
111 }
112
113 public void setCaseSensitive( boolean caseSensitive )
114 {
115 this.caseSensitive = caseSensitive;
116 }
117
118 /**
119 * Retrieves the included and excluded files from this file-set's directory. Specifically,
120 * <code>"file-set: <I>[directory]</I> (included:
121 * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
122 *
123 * @return The included and excluded files from this file-set's directory. Specifically,
124 * <code>"file-set: <I>[directory]</I> (included:
125 * <I>[included files]</I>, excluded: <I>[excluded files]</I>)"</code>
126 * @see java.lang.Object#toString()
127 */
128 public String toString()
129 {
130 return "file-set: " + getDirectory() + " (included: " + Arrays.toString( getIncludes() ) + ", excluded: " + Arrays.toString( getExcludes() ) + ")";
131 }
132
133 public boolean isUseDefaultExcludes()
134 {
135 return useDefaultExcludes;
136 }
137
138 public void setUseDefaultExcludes( boolean useDefaultExcludes )
139 {
140 this.useDefaultExcludes = useDefaultExcludes;
141 }
142
143 public String getOutputDirectory()
144 {
145 return outputDirectory;
146 }
147
148 public void setOutputDirectory( String outputDirectory )
149 {
150 this.outputDirectory = outputDirectory;
151 }
152
153 }