org.apache.tools.ant.taskdefs.optional
Class Cab

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.MatchingTask
                    |
                    +--org.apache.tools.ant.taskdefs.optional.Cab
All Implemented Interfaces:
SelectorContainer

public class Cab
extends MatchingTask

Create a CAB archive.


Field Summary
protected  java.lang.String archiveType
           
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
Cab()
           
 
Method Summary
 void addFileset(FileSet set)
          Adds a set of files to archive.
protected  void appendFiles(java.util.Vector files, DirectoryScanner ds)
          Append all files found by a directory scanner to a vector.
protected  void checkConfiguration()
           
protected  ExecTask createExec()
          Create a new exec delegate.
protected  java.io.File createListFile(java.util.Vector files)
          Creates a list file.
 void execute()
          Called by the project to let the task do its work.
protected  java.util.Vector getFileList()
          Get the complete list of files to be included in the cab.
protected  boolean isUpToDate(java.util.Vector files)
          Check to see if the target is up to date with respect to input files.
 void setBasedir(java.io.File baseDir)
          Base directory to look in for files to CAB.
 void setCabfile(java.io.File cabFile)
          The name/location of where to create the .cab file.
 void setCompress(boolean compress)
          If true, compress the files otherwise only store them.
 void setOptions(java.lang.String options)
          Sets additional cabarc options that are not supported directly.
 void setVerbose(boolean verbose)
          If true, display cabarc output.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


setBasedir

public void setBasedir(java.io.File baseDir)
Base directory to look in for files to CAB.


setCompress

public void setCompress(boolean compress)
If true, compress the files otherwise only store them.


setVerbose

public void setVerbose(boolean verbose)
If true, display cabarc output.


setOptions

public void setOptions(java.lang.String options)
Sets additional cabarc options that are not supported directly.


addFileset

public void addFileset(FileSet set)
Adds a set of files to archive.


checkConfiguration

protected void checkConfiguration()
                           throws BuildException
BuildException

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.

BuildException

isUpToDate

protected boolean isUpToDate(java.util.Vector files)
Check to see if the target is up to date with respect to input files.

Returns:
true if the cab file is newer than its dependents.

createListFile

protected java.io.File createListFile(java.util.Vector 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.

java.io.IOException

appendFiles

protected void appendFiles(java.util.Vector files,
                           DirectoryScanner ds)
Append all files found by a directory scanner to a vector.


getFileList

protected java.util.Vector getFileList()
                                throws BuildException
Get the complete list of files to be included in the cab. Filenames are gathered from filesets if any have been added, otherwise from the traditional include parameters.

BuildException

execute

public void execute()
             throws BuildException
Description copied from class: Task
Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.

Overrides:
execute in class Task
Throws:
BuildException - if something goes wrong with the build


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.