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
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Set the source resource.void
execute()
validate, then hand off to the subclassThe source resource.protected abstract void
pack()
subclasses must implement this method to do their compressionvoid
setDestfile
(File zipFile) the required destination file.void
the file to compress; required.void
setSrcResource
(Resource src) The resource to pack; required.void
setZipfile
(File zipFile) the required destination file.protected boolean
Whether this task can deal with non-file resources.protected void
zipFile
(File file, OutputStream zOut) zip a file to an output streamprotected void
zipResource
(Resource resource, OutputStream zOut) zip a resource to an output streamMethods 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
-
Field Details
-
zipFile
-
source
-
-
Constructor Details
-
Pack
public Pack()
-
-
Method Details
-
setZipfile
the required destination file.- Parameters:
zipFile
- the destination file
-
setDestfile
the required destination file.- Parameters:
zipFile
- the destination file
-
setSrc
-
setSrcResource
The resource to pack; required.- Parameters:
src
- resource to expand
-
addConfigured
Set the source resource.- Parameters:
a
- the resource to pack as a single element Resource collection.
-
execute
validate, then hand off to the subclass- Overrides:
execute
in classTask
- Throws:
BuildException
- on error
-
zipFile
zip a file to an output stream- Parameters:
file
- the file to zipzOut
- the output stream- Throws:
IOException
- on error
-
zipResource
zip a resource to an output stream- Parameters:
resource
- the resource to zipzOut
- the output stream- Throws:
IOException
- on error
-
pack
protected abstract void pack()subclasses must implement this method to do their compression -
getSrcResource
-
supportsNonFileResources
protected boolean supportsNonFileResources()Whether this task can deal with non-file resources.This implementation returns false.
- Returns:
- false.
- Since:
- Ant 1.7
-