## 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

Direct Known Subclasses:
  BZip2, GZip

public abstract class Pack
extends Task

Abstract Base class for pack tasks.

Since:
  Ant 1.5
Author:
  Magesh Umasankar

Field Summary
`protected java.io.File` `source`
`protected java.io.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`

Constructor Summary
`Pack()`

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` `setSrc(java.io.File src)` the file to compress; required.
`void` `setZipfile(java.io.File zipFile)` the required destination file.
`protected void` `zipFile(java.io.File file, java.io.OutputStream zOut)` zip a file to an output stream

Methods inherited from class org.apache.tools.ant.Task
`getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorFlush, handleErrorOutput, handleFlush, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName`

Methods inherited from class org.apache.tools.ant.ProjectComponent
`getProject, setProject`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### zipFile

    protected java.io.File zipFile

### source

    protected java.io.File source

Constructor Detail

### Pack

    public Pack()

Method Detail

### setZipfile

    public void setZipfile(java.io.File zipFile)

  the required destination file.

  Parameters:
    `zipFile` -

### setSrc

    public void setSrc(java.io.File src)

  the file to compress; required.

  Parameters:
    `src` -

### execute

    public void execute()
                 throws BuildException

  validate, then hand off to the subclass

  Overrides:
    `execute` in class `Task`
  Throws:
    `BuildException`

### zipFile

    protected void zipFile(java.io.File file,
                           java.io.OutputStream zOut)
                    throws java.io.IOException

  zip a file to an output stream

  Parameters:
    `file` -
    `zOut` -
  Throws:
    `java.io.IOException`

### pack

    protected abstract void pack()

  subclasses must implement this method to do their compression

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