org.apache.tools.ant.taskdefs

## Class GZip

- java.lang.Object
- - org.apache.tools.ant.ProjectComponent
  - - org.apache.tools.ant.Task
    - - org.apache.tools.ant.taskdefs.Pack
      - - org.apache.tools.ant.taskdefs.GZip

- All Implemented Interfaces:
    java.lang.Cloneable

      public class GZip
      extends Pack

  Compresses a file with the GZIP algorithm. Normally used to compress non-compressed archives such as TAR files.
  Since:
    Ant 1.1

- - ### Field Summary

    - ### Fields inherited from class org.apache.tools.ant.taskdefs.Pack

      `source, zipFile`

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

      `target, taskName, taskType, wrapper`

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

      `description, location, project`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GZip()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `pack()` perform the GZip compression operation.
    `protected boolean` | `supportsNonFileResources()` Whether this task can deal with non-file resources.

    - ### Methods inherited from class org.apache.tools.ant.taskdefs.Pack

      `addConfigured, execute, getSrcResource, setDestfile, setSrc, setSrcResource, setZipfile, zipFile, zipResource`

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

    - #### GZip

          public GZip()

  - ### Method Detail

    - #### pack

          protected void pack()

      perform the GZip compression operation.
      Specified by:
        `pack` in class `Pack`

    - #### supportsNonFileResources

          protected boolean supportsNonFileResources()

      Whether this task can deal with non-file resources.

      This implementation returns true only if this task is <gzip>. Any subclass of this class that also wants to support non-file resources needs to override this method. We need to do so for backwards compatibility reasons since we can't expect subclasses to support resources.

      Overrides:
        `supportsNonFileResources` in class `Pack`
      Returns:
        true if this case supports non file resources.
      Since:
        Ant 1.7