Class Cab

    • Field Detail

      • archiveType

        protected java.lang.String archiveType
    • Constructor Detail

      • Cab

        public Cab()
    • Method Detail

      • setCabfile

        public void setCabfile​(java.io.File cabFile)
        The name/location of where to create the .cab file.
        Parameters:
        cabFile - the location of the cab file.
      • setBasedir

        public void setBasedir​(java.io.File baseDir)
        Base directory to look in for files to CAB.
        Parameters:
        baseDir - base directory for files to cab.
      • setCompress

        public void setCompress​(boolean compress)
        If true, compress the files otherwise only store them.
        Parameters:
        compress - a boolean value.
      • setVerbose

        public void setVerbose​(boolean verbose)
        If true, display cabarc output.
        Parameters:
        verbose - a boolean value.
      • setOptions

        public void setOptions​(java.lang.String options)
        Sets additional cabarc options that are not supported directly.
        Parameters:
        options - cabarc command line options.
      • addFileset

        public void addFileset​(FileSet fileset)
        Adds a set of files to archive.
        Parameters:
        fileset - a set of files to archive.
      • checkConfiguration

        protected void checkConfiguration()
                                   throws BuildException
        Check if the attributes and nested elements are correct.
        Throws:
        BuildException - on error.
      • createExec

        protected ExecTask createExec()
                               throws BuildException
        Create a new exec delegate. The delegate task is populated so that it appears in the logs to be the same task as this one.
        Returns:
        the delegate.
        Throws:
        BuildException - on error.
      • isUpToDate

        protected boolean isUpToDate​(java.util.Vector<java.lang.String> files)
        Check to see if the target is up to date with respect to input files.
        Parameters:
        files - the list of files to check.
        Returns:
        true if the cab file is newer than its dependents.
      • createListFile

        protected java.io.File createListFile​(java.util.Vector<java.lang.String> files)
                                       throws java.io.IOException
        Creates a list file. This temporary file contains a list of all files to be included in the cab, one file per line.

        This method expects to only be called on Windows and thus quotes the file names.

        Parameters:
        files - the list of files to use.
        Returns:
        the list file created.
        Throws:
        java.io.IOException - if there is an error.
      • appendFiles

        protected void appendFiles​(java.util.Vector<java.lang.String> files,
                                   DirectoryScanner ds)
        Append all files found by a directory scanner to a vector.
        Parameters:
        files - the vector to append the files to.
        ds - the scanner to get the files from.
      • getFileList

        protected java.util.Vector<java.lang.String> getFileList()
                                                          throws BuildException
        Get the complete list of files to be included in the cab. Filenames are gathered from the fileset if it has been added, otherwise from the traditional include parameters.
        Returns:
        the list of files.
        Throws:
        BuildException - if there is an error.