Subversion Repositories XServices

Rev

Rev 6 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 10
Line 11... Line 11...
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
14
 *   limitations under the License.
15
 */
15
 */
16
 
-
 
17
package net.brutex.xservices.types;
16
package net.brutex.xservices.types;
Line 18... Line 17...
18
 
17
 
19
import java.io.File;
18
import java.io.File;
20
import javax.xml.bind.annotation.XmlElement;
19
import javax.xml.bind.annotation.XmlElement;
Line 25... Line 24...
25
import org.apache.tools.ant.types.Resource;
24
import org.apache.tools.ant.types.Resource;
26
import org.apache.tools.ant.types.TarFileSet;
25
import org.apache.tools.ant.types.TarFileSet;
27
import org.apache.tools.ant.types.ZipFileSet;
26
import org.apache.tools.ant.types.ZipFileSet;
Line 28... Line 27...
28
 
27
 
-
 
28
/**
29
/**
29
 * Set of files from various sources.
30
 *
30
 *
31
 * @author Brian Rosenberger, bru@brutex.de
31
 * @author Brian Rosenberger, bru@brutex.de
32
 */
32
 */
33
@XmlType(name="FileSetType", namespace="http://ws.xservices.brutex.net",
33
@XmlType(name = "FileSetType", namespace = "http://ws.xservices.brutex.net",
34
    propOrder={"type", "source", "includes", "excludes", "casesensitive"})
34
propOrder = {"type", "source", "includes", "excludes", "casesensitive"})
Line -... Line 35...
-
 
35
public class FileSetResource {
-
 
36
 
-
 
37
    /**
35
public class FileSetResource {
38
     * Type of FileSet
36
 
39
     */
-
 
40
    @XmlElement(name = "FileSetType", required = true, nillable = false, defaultValue = "FILES")
-
 
41
    public FileSetType type = FileSetType.FILES;
37
    @XmlElement(name="FileSetType", required=true, nillable=false, defaultValue="FILES")
42
    /**
-
 
43
     * File set source.
-
 
44
     * 
-
 
45
     * Depends on the file set type. This is either an archive file or a
38
    public FileSetType type = FileSetType.FILES;
46
     * directory.
39
 
47
     */
-
 
48
    @XmlElement(name = "source", required = true, nillable = false)
-
 
49
    public String source = "";
40
    @XmlElement(name="source", required=true, nillable=false)
50
    /**
-
 
51
     * Pattern of files to include.
41
    public String source = "";
52
     * 
42
 
53
     */
-
 
54
    @XmlElement(name = "includes", required = true, nillable = false, defaultValue = "**/*")
-
 
55
    public String includes = "";
43
    @XmlElement(name="includes", required=true, nillable=false, defaultValue="**/*")
56
    /**
44
    public String includes = "";
57
     * Pattern of files to exclude.
45
 
58
     */
-
 
59
    @XmlElement(name = "excludes", required = false, nillable = true, defaultValue = "")
-
 
60
    public String excludes = "";
46
    @XmlElement(name="excludes", required=false, nillable=true, defaultValue="")
61
    /**
47
    public String excludes ="";
62
     * Case sensitivity for include/ exclude patterns.
48
 
63
     */
Line -... Line 64...
-
 
64
    @XmlElement(name = "casesensitive", required = true, nillable = false, defaultValue = "true")
-
 
65
    public boolean casesensitive = true;
-
 
66
 
-
 
67
    /**
-
 
68
     * Get Ant FileSet for this file set.
-
 
69
     *
49
    @XmlElement(name="casesensitive", required=true, nillable=false, defaultValue="true")
70
     * @param p     Ant project
50
    public boolean casesensitive = true;
71
     * @return      Ant FileSet for this file set.
51
 
72
     */
52
    public FileSet getAntFileSet(Project p) {
73
    public FileSet getAntFileSet(Project p) {
53
        FileSet set = null;
74
        FileSet set = null;
54
        switch(type) {
75
        switch (type) {
55
            case ZIP:
76
            case ZIP:
56
                ZipFileSet zset = new ZipFileSet();
77
                ZipFileSet zset = new ZipFileSet();
Line 79... Line 100...
79
        set.setCaseSensitive(casesensitive);
100
        set.setCaseSensitive(casesensitive);
Line 80... Line 101...
80
 
101
 
81
        return set;
102
        return set;
Line -... Line 103...
-
 
103
    }
-
 
104
 
-
 
105
    /**
82
    }
106
     * File set types.
83
 
107
     */
84
    @XmlEnum
-
 
85
    public enum FileSetType{
-
 
Line -... Line 108...
-
 
108
    @XmlEnum
-
 
109
    public enum FileSetType {
-
 
110
 
-
 
111
        /**
-
 
112
         * Set of files (this is based on a directory, so provide a path only
-
 
113
         * as file set source).
-
 
114
         */
-
 
115
        FILES,
-
 
116
        /**
-
 
117
         * Set of files inside a ZIP archive.
-
 
118
         */
-
 
119
        ZIP,
-
 
120
        /**
-
 
121
         * Set of files inside a TAR archive (without compression).
-
 
122
         */
-
 
123
        TAR,
-
 
124
        /**
-
 
125
         * Set of files inside a gzip compressed TAR archive.
86
        FILES, ZIP, TAR, GZTAR
126
         */