Class Pack

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    BZip2, GZip, Xz

    public abstract class Pack
    extends Task
    Abstract Base class for pack tasks.
    Since:
    Ant 1.5
    • Field Detail

      • zipFile

        protected java.io.File zipFile
      • source

        protected java.io.File source
    • Constructor Detail

      • Pack

        public Pack()
    • Method Detail

      • setZipfile

        public void setZipfile​(java.io.File zipFile)
        the required destination file.
        Parameters:
        zipFile - the destination file
      • setDestfile

        public void setDestfile​(java.io.File zipFile)
        the required destination file.
        Parameters:
        zipFile - the destination file
      • setSrc

        public void setSrc​(java.io.File src)
        the file to compress; required.
        Parameters:
        src - the source file
      • setSrcResource

        public void setSrcResource​(Resource src)
        The resource to pack; required.
        Parameters:
        src - resource to expand
      • addConfigured

        public void addConfigured​(ResourceCollection a)
        Set the source resource.
        Parameters:
        a - the resource to pack as a single element Resource collection.
      • zipFile

        protected void zipFile​(java.io.File file,
                               java.io.OutputStream zOut)
                        throws java.io.IOException
        zip a file to an output stream
        Parameters:
        file - the file to zip
        zOut - the output stream
        Throws:
        java.io.IOException - on error
      • zipResource

        protected void zipResource​(Resource resource,
                                   java.io.OutputStream zOut)
                            throws java.io.IOException
        zip a resource to an output stream
        Parameters:
        resource - the resource to zip
        zOut - the output stream
        Throws:
        java.io.IOException - on error
      • pack

        protected abstract void pack()
        subclasses must implement this method to do their compression
      • getSrcResource

        public Resource getSrcResource()
        The source resource.
        Returns:
        the source.
        Since:
        Ant 1.7
      • supportsNonFileResources

        protected boolean supportsNonFileResources()
        Whether this task can deal with non-file resources.

        This implementation returns false.

        Returns:
        false.
        Since:
        Ant 1.7