org.apache.tools.ant.taskdefs

Class Pack

Known Direct Subclasses:
BZip2, GZip

public abstract class Pack
extends Task

Abstract Base class for pack tasks.
Since:
Ant 1.5

Field Summary

protected File
source
protected File
zipFile

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

Method Summary

void
execute()
validate, then hand off to the subclass
protected abstract void
pack()
subclasses must implement this method to do their compression
void
setDestfile(File zipFile)
the required destination file.
void
setSrc(File src)
the file to compress; required.
void
setZipfile(File zipFile)
the required destination file.
protected void
zipFile(File file, OutputStream zOut)
zip a file to an output stream

Methods inherited from class org.apache.tools.ant.Task

execute, 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, log, log, setProject

Field Details

source

protected File source

zipFile

protected File zipFile

Method Details

execute

public void execute()
            throws BuildException
validate, then hand off to the subclass
Overrides:
execute in interface Task
Throws:
BuildException -

pack

protected abstract void pack()
subclasses must implement this method to do their compression

setDestfile

public void setDestfile(File zipFile)
the required destination file.
Parameters:
zipFile -

setSrc

public void setSrc(File src)
the file to compress; required.
Parameters:
src -

setZipfile

public void setZipfile(File zipFile)
the required destination file.
Parameters:
zipFile -

zipFile

protected void zipFile(File file,
                       OutputStream zOut)
            throws IOException
zip a file to an output stream
Parameters:
file -
zOut -

Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.