Subversion Repositories XServices

Rev

Rev 6 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 10
Line 18... Line 18...
18
 
18
 
19
import java.io.File;
19
import java.io.File;
20
import javax.xml.bind.annotation.XmlElement;
20
import javax.xml.bind.annotation.XmlElement;
21
import javax.xml.bind.annotation.XmlEnum;
21
import javax.xml.bind.annotation.XmlEnum;
-
 
22
import javax.xml.bind.annotation.XmlType;
22
import javax.xml.bind.annotation.XmlType;
23
import net.brutex.xservices.util.BrutexNamespaces;
23
import org.apache.tools.ant.Project;
24
import org.apache.tools.ant.Project;
24
import org.apache.tools.ant.types.Resource;
25
import org.apache.tools.ant.types.Resource;
25
import org.apache.tools.ant.types.resources.TarResource;
26
import org.apache.tools.ant.types.resources.TarResource;
26
import org.apache.tools.ant.types.resources.ZipResource;
27
import org.apache.tools.ant.types.resources.ZipResource;
27
import org.apache.tools.tar.TarEntry;
28
import org.apache.tools.tar.TarEntry;
Line 28... Line 29...
28
import org.apache.tools.zip.ZipEntry;
29
import org.apache.tools.zip.ZipEntry;
-
 
30
 
29
 
31
/**
-
 
32
 * Resource from archive declaration.
30
/**
33
 *
31
 * 
34
 * Defines a resource within an archive.
32
 * @author Brian Rosenberger, bru@brutex.de
35
 * @author Brian Rosenberger, bru@brutex.de
33
 */
36
 */
34
@XmlType(namespace = "http://ws.xservices.brutex.net")
37
@XmlType(namespace = BrutexNamespaces.WS_XSERVICES, name="ArchiveResourceType")
Line -... Line 38...
-
 
38
public class ArchiveResource
-
 
39
        implements ResourceInterface {
-
 
40
 
35
public class ArchiveResource
41
    /**
36
        implements ResourceInterface {
42
     * Archive Type.
-
 
43
     */
-
 
44
    @XmlElement(defaultValue = "ZIP", nillable = false, required = true)
-
 
45
    public ArchiveType type = ArchiveType.ZIP;
-
 
46
 
-
 
47
    /**
-
 
48
     * Archive file.
37
 
49
     *
38
    @XmlElement(defaultValue = "ZIP", nillable = false, required = true)
50
     * Path and filename of the archive to use.
-
 
51
     */
-
 
52
    @XmlElement(nillable = false, required = true)
-
 
53
    public String archive;
-
 
54
 
-
 
55
    /**
-
 
56
     * URI within the archive.
-
 
57
     *
-
 
58
     * This is usually a filename or a path/filename combination. Relative paths
-
 
59
     * are based from the archive root. It depends on how the archive has been
39
    public ArchiveType type = ArchiveType.ZIP;
60
     * created wether or not it is possible to use relative paths, absolute
40
    @XmlElement(nillable = false, required = true)
61
     * paths are required otherwise. Uses "/" as separator.
Line -... Line 62...
-
 
62
     */
-
 
63
    @XmlElement(nillable = false, required = true)
-
 
64
    public String uri;
41
    public String archive;
65
 
42
    @XmlElement(nillable = false, required = true)
66
    /**
Line -... Line 67...
-
 
67
     * Supported archive types.
-
 
68
     */
-
 
69
    @XmlEnum(value=String.class)
-
 
70
    public enum ArchiveType {
-
 
71
 
-
 
72
        /**
-
 
73
         * Zip archive type.
-
 
74
         */
-
 
75
        ZIP,
-
 
76
 
-
 
77
        /**
-
 
78
         * Tar archive type, without compression
-
 
79
         */
43
    public String uri;
80
        TAR,
44
 
81
        
Line -... Line 82...
-
 
82
        /**
-
 
83
         * Tar archive type, with GZIP compression
-
 
84
         */
-
 
85
        GZTAR
-
 
86
    }
-
 
87
 
45
    @XmlEnum(String.class)
88
    /**
46
    public enum ArchiveType {
89
     * Get Apache Ant Resource Type.
47
 
90
     *
48
        ZIP, TAR, GZTAR
91
     * @param p     Ant project
49
    }
92
     * @return      this ArchiveResource as Ant Resource