001 /**
002 * Copyright 2008-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.codehaus.mojo.wagon.shared;
017
018 /*
019 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
020 * agreements. See the NOTICE file distributed with this work for additional information regarding
021 * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
022 * "License"); you may not use this file except in compliance with the License. You may obtain a
023 * copy of the License at
024 *
025 * http://www.apache.org/licenses/LICENSE-2.0
026 *
027 * Unless required by applicable law or agreed to in writing, software distributed under the License
028 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
029 * or implied. See the License for the specific language governing permissions and limitations under
030 * the License.
031 */
032
033
034 import java.io.File;
035
036
037 /**
038 * Wagon configuration to scan for a set of remote files.
039 */
040 public class WagonFileSet
041 {
042 /**
043 * Path after the url, this is where the scan starts
044 */
045
046 private String directory = "";
047
048 /**
049 * Ant's excludes path expression
050 */
051 private String [] excludes;
052
053 /**
054 * Ant's includes path expression
055 */
056 private String [] includes;
057
058 /**
059 *
060 */
061 private boolean caseSensitive;
062
063
064 /**
065 * User default exclude sets
066 */
067 private boolean useDefaultExcludes = true;
068
069 /**
070 * Local path to download the remote resource ( tree ) to.
071 */
072 private File downloadDirectory;
073
074 /**
075 * Relative of a remote URL when it used to copy files between 2 URLs.
076 */
077 private String outputDirectory = "";
078
079 //////////////////////////////////////////////////////////////////////////////////////
080
081 public String getDirectory()
082 {
083 return directory;
084 }
085
086 public void setDirectory( String remotePath )
087 {
088 this.directory = remotePath;
089 }
090
091 public File getDownloadDirectory()
092 {
093 return downloadDirectory;
094 }
095
096 public void setDownloadDirectory( File downloadDirectory )
097 {
098 this.downloadDirectory = downloadDirectory;
099 }
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 }