org.apache.tools.ant.taskdefsClass Pack
- java.lang.Object
- org.apache.tools.ant.ProjectComponent
- org.apache.tools.ant.Task
- org.apache.tools.ant.taskdefs.Pack
Field Summary
Fields Modifier and Type Field and Description protected java.io.Filesourceprotected java.io.FilezipFile
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
Constructor Summary
Constructors Constructor and Description Pack()
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddConfigured(ResourceCollection a)Set the source resource.voidexecute()validate, then hand off to the subclassResourcegetSrcResource()The source resource.protected abstract voidpack()subclasses must implement this method to do their compressionvoidsetDestfile(java.io.File zipFile)the required destination file.voidsetSrc(java.io.File src)the file to compress; required.voidsetSrcResource(Resource src)The resource to pack; required.voidsetZipfile(java.io.File zipFile)the required destination file.protected booleansupportsNonFileResources()Whether this task can deal with non-file resources.protected voidzipFile(java.io.File file, java.io.OutputStream zOut)zip a file to an output streamprotected voidzipResource(Resource resource, java.io.OutputStream zOut)zip a resource to an output stream
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
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.
execute
public void execute() throws BuildExceptionvalidate, then hand off to the subclass
- Overrides:
executein classTask- Throws:
BuildException- on error
zipFile
protected void zipFile(java.io.File file, java.io.OutputStream zOut) throws java.io.IOExceptionzip a file to an output stream
- Parameters:
file- the file to zipzOut- the output stream- Throws:
java.io.IOException- on error
zipResource
protected void zipResource(Resource resource, java.io.OutputStream zOut) throws java.io.IOExceptionzip a resource to an output stream
- Parameters:
resource- the resource to zipzOut- 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