org.apache.ant.compress.taskdefs

## Class PackBase

- java.lang.Object
- - org.apache.tools.ant.ProjectComponent
  - - org.apache.tools.ant.Task
    - - org.apache.ant.compress.taskdefs.PackBase

- All Implemented Interfaces:
    java.lang.Cloneable
  Direct Known Subclasses:
    BZip2, Deflate, GZip, LZ4, LZMA, Pack200, Snappy, XZ

      public abstract class PackBase
      extends org.apache.tools.ant.Task

  Abstract Base class for pack tasks.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `PackBase.ResourceWrapper`

  - ### Field Summary

    - ### Fields inherited from class org.apache.tools.ant.Task

      `target, taskName, taskType`

    - ### Fields inherited from class org.apache.tools.ant.ProjectComponent

      `description, location, project`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PackBase(CompressorStreamFactory factory, PackBase.ResourceWrapper wrapper)`
    `protected` | `PackBase(PackBase.ResourceWrapper wrapper)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(ArchiveBase task)`
    `void` | `add(PackBase task)`
    `void` | `addConfigured(org.apache.tools.ant.types.ResourceCollection a)` Set the source resource.
    `void` | `addConfiguredDest(org.apache.tools.ant.types.resources.Resources r)` The archive to create.
    `void` | `execute()` validate, then hand off to the subclass
    `protected org.apache.tools.ant.types.Resource` | `getSrc()`
    `void` | `setDest(org.apache.tools.ant.types.Resource dest)` The resource to pack; required.
    `void` | `setDestfile(java.io.File dest)` the required destination file.
    `protected void` | `setFactory(CompressorStreamFactory factory)`
    `void` | `setSrc(org.apache.tools.ant.types.Resource src)` The resource to pack; required.
    `void` | `setSrcfile(java.io.File src)` the file to compress; required.

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

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PackBase

          protected PackBase(CompressorStreamFactory factory,
                             PackBase.ResourceWrapper wrapper)

    - #### PackBase

          protected PackBase(PackBase.ResourceWrapper wrapper)

      Since:
        Apache Compress Antlib 1.1

  - ### Method Detail

    - #### setFactory

          protected final void setFactory(CompressorStreamFactory factory)

      Since:
        Apache Compress Antlib 1.1

    - #### setDestfile

          public void setDestfile(java.io.File dest)

      the required destination file.

    - #### setDest

          public void setDest(org.apache.tools.ant.types.Resource dest)

      The resource to pack; required.
      Parameters:
        `dest` - resource to expand

    - #### addConfiguredDest

          public void addConfiguredDest(org.apache.tools.ant.types.resources.Resources r)

      The archive to create.

    - #### setSrcfile

          public void setSrcfile(java.io.File src)

      the file to compress; required.
      Parameters:
        `src` - the source file

    - #### setSrc

          public void setSrc(org.apache.tools.ant.types.Resource src)

      The resource to pack; required.
      Parameters:
        `src` - resource to expand

    - #### addConfigured

          public void addConfigured(org.apache.tools.ant.types.ResourceCollection a)

      Set the source resource.
      Parameters:
        `a` - the resource to pack as a single element Resource collection.

    - #### add

          public void add(ArchiveBase task)

    - #### add

          public void add(PackBase task)

      Since:
        Apache Compress Antlib 1.1

    - #### execute

          public void execute()
                       throws org.apache.tools.ant.BuildException

      validate, then hand off to the subclass
      Overrides:
        `execute` in class `org.apache.tools.ant.Task`
      Throws:
        `org.apache.tools.ant.BuildException` - on error

    - #### getSrc

          protected final org.apache.tools.ant.types.Resource getSrc()

      Since:
        Apache Compress Antlib 1.5