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