Package org.apache.tools.ant.taskdefs
Class Pack
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Pack
- All Implemented Interfaces:
- Cloneable
Abstract Base class for pack tasks.
- Since:
- Ant 1.5
- 
Field SummaryFieldsFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidSet the source resource.voidexecute()validate, then hand off to the subclassThe source resource.protected abstract voidpack()subclasses must implement this method to do their compressionvoidsetDestfile(File zipFile) the required destination file.voidthe file to compress; required.voidsetSrcResource(Resource src) The resource to pack; required.voidsetZipfile(File zipFile) the required destination file.protected booleanWhether this task can deal with non-file resources.protected voidzipFile(File file, OutputStream zOut) zip a file to an output streamprotected voidzipResource(Resource resource, OutputStream zOut) zip a resource to an output streamMethods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Field Details- 
zipFile
- 
source
 
- 
- 
Constructor Details- 
Packpublic Pack()
 
- 
- 
Method Details- 
setZipfilethe required destination file.- Parameters:
- zipFile- the destination file
 
- 
setDestfilethe required destination file.- Parameters:
- zipFile- the destination file
 
- 
setSrcthe file to compress; required.- Parameters:
- src- the source file
 
- 
setSrcResourceThe resource to pack; required.- Parameters:
- src- resource to expand
 
- 
addConfiguredSet the source resource.- Parameters:
- a- the resource to pack as a single element Resource collection.
 
- 
executevalidate, then hand off to the subclass- Overrides:
- executein class- Task
- Throws:
- BuildException- on error
 
- 
zipFilezip a file to an output stream- Parameters:
- file- the file to zip
- zOut- the output stream
- Throws:
- IOException- on error
 
- 
zipResourcezip a resource to an output stream- Parameters:
- resource- the resource to zip
- zOut- the output stream
- Throws:
- IOException- on error
 
- 
packprotected abstract void pack()subclasses must implement this method to do their compression
- 
getSrcResourceThe source resource.- Returns:
- the source.
- Since:
- Ant 1.7
 
- 
supportsNonFileResourcesprotected boolean supportsNonFileResources()Whether this task can deal with non-file resources.This implementation returns false. - Returns:
- false.
- Since:
- Ant 1.7
 
 
-