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 import java.io.File;
019
020 /**
021 * Wagon configuration to scan for a set of remote files.
022 */
023 public class WagonFileSet {
024
025 /**
026 * Path after the url, this is where the scan starts
027 */
028 private String directory = "";
029
030 /**
031 * Ant's excludes path expression
032 */
033 private String[] excludes;
034
035 /**
036 * Ant's includes path expression
037 */
038 private String[] includes;
039
040 /**
041 *
042 */
043 private boolean caseSensitive;
044
045 /**
046 * User default exclude sets
047 */
048 private boolean useDefaultExcludes = true;
049
050 /**
051 * Local path to download the remote files to
052 */
053 private File downloadDirectory;
054
055 /**
056 * Relative to the remote URL. Used to copy files between 2 URLs.
057 */
058 private String outputDirectory = "";
059
060 public String getDirectory() {
061 return directory;
062 }
063
064 public void setDirectory(String remotePath) {
065 this.directory = remotePath;
066 }
067
068 public File getDownloadDirectory() {
069 return downloadDirectory;
070 }
071
072 public void setDownloadDirectory(File downloadDirectory) {
073 this.downloadDirectory = downloadDirectory;
074 }
075
076 public String[] getExcludes() {
077 return excludes;
078 }
079
080 public void setExcludes(String[] excludes) {
081 this.excludes = excludes;
082 }
083
084 public String[] getIncludes() {
085 return includes;
086 }
087
088 public void setIncludes(String[] includes) {
089 this.includes = includes;
090 }
091
092 public boolean isCaseSensitive() {
093 return caseSensitive;
094 }
095
096 public void setCaseSensitive(boolean caseSensitive) {
097 this.caseSensitive = caseSensitive;
098 }
099
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 }