org.apache.ant.compress.resources

## Class CommonsCompressArchiveResource

- java.lang.Object
- - org.apache.tools.ant.ProjectComponent
  - - org.apache.tools.ant.types.DataType
    - - org.apache.tools.ant.types.Resource
      - - org.apache.tools.ant.types.resources.ArchiveResource
        - - org.apache.ant.compress.resources.CommonsCompressArchiveResource

- All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<org.apache.tools.ant.types.Resource>, java.lang.Iterable<org.apache.tools.ant.types.Resource>, org.apache.tools.ant.types.ResourceCollection
  Direct Known Subclasses:
    ArjResource, ArResource, CpioResource, DumpResource, SevenZResource, TarResource, ZipResource

      public abstract class CommonsCompressArchiveResource
      extends org.apache.tools.ant.types.resources.ArchiveResource

  A Resource representation of an entry in a commons compress archive.

- - ### Field Summary

    - ### Fields inherited from class org.apache.tools.ant.types.Resource

      `MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE`

    - ### Fields inherited from class org.apache.tools.ant.types.DataType

      `checked, ref`

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

      `description, location, project`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CommonsCompressArchiveResource(ArchiveStreamFactory factory, java.lang.String archiveType)` Default constructor.
    `protected` | `CommonsCompressArchiveResource(ArchiveStreamFactory factory, java.lang.String archiveType, java.io.File a, org.apache.commons.compress.archivers.ArchiveEntry e)` Construct a Resource representing the specified entry in the specified archive.
    `protected` | `CommonsCompressArchiveResource(ArchiveStreamFactory factory, java.lang.String archiveType, org.apache.tools.ant.types.Resource a, org.apache.commons.compress.archivers.ArchiveEntry e)` Construct a Resource representing the specified entry in the specified archive.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `fetchEntry()` fetches information from the named entry inside the archive.
    `java.lang.String` | `getEncoding()` Get the encoding to use with the zipfile.
    `int` | `getGid()`
    `java.io.InputStream` | `getInputStream()` Return an InputStream for reading the contents of this Resource.
    `java.io.OutputStream` | `getOutputStream()` Get an OutputStream for the Resource.
    `int` | `getUid()`
    `void` | `setEncoding(java.lang.String enc)` Set the encoding to use with the archive.
    `protected void` | `setEntry(org.apache.commons.compress.archivers.ArchiveEntry e)`
    `void` | `setRefid(org.apache.tools.ant.types.Reference r)` Overrides the super version.

    - ### Methods inherited from class org.apache.tools.ant.types.resources.ArchiveResource

      `addConfigured, checkEntry, compareTo, dieOnCircularReference, equals, getArchive, getLastModified, getMode, getSize, hashCode, isDirectory, isExists, setArchive, setMode, toString`

    - ### Methods inherited from class org.apache.tools.ant.types.Resource

      `as, clone, getMagicNumber, getName, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setSize, size, toLongString`

    - ### Methods inherited from class org.apache.tools.ant.types.DataType

      `checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes`

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

      `getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Constructor Detail

    - #### CommonsCompressArchiveResource

          protected CommonsCompressArchiveResource(ArchiveStreamFactory factory,
                                                   java.lang.String archiveType)

      Default constructor.

    - #### CommonsCompressArchiveResource

          protected CommonsCompressArchiveResource(ArchiveStreamFactory factory,
                                                   java.lang.String archiveType,
                                                   java.io.File a,
                                                   org.apache.commons.compress.archivers.ArchiveEntry e)

      Construct a Resource representing the specified entry in the specified archive.
      Parameters:
        `a` - the archive as File.
        `e` - the ArchiveEntry.

    - #### CommonsCompressArchiveResource

          protected CommonsCompressArchiveResource(ArchiveStreamFactory factory,
                                                   java.lang.String archiveType,
                                                   org.apache.tools.ant.types.Resource a,
                                                   org.apache.commons.compress.archivers.ArchiveEntry e)

      Construct a Resource representing the specified entry in the specified archive.
      Parameters:
        `a` - the archive as Resource.
        `e` - the ArchiveEntry.

  - ### Method Detail

    - #### setEncoding

          public void setEncoding(java.lang.String enc)

      Set the encoding to use with the archive.
      Parameters:
        `enc` - the String encoding.

    - #### getEncoding

          public java.lang.String getEncoding()

      Get the encoding to use with the zipfile.
      Returns:
        String encoding.

    - #### setRefid

          public void setRefid(org.apache.tools.ant.types.Reference r)

      Overrides the super version.
      Overrides:
        `setRefid` in class `org.apache.tools.ant.types.resources.ArchiveResource`
      Parameters:
        `r` - the Reference to set.

    - #### getInputStream

          public java.io.InputStream getInputStream()
                                             throws java.io.IOException

      Return an InputStream for reading the contents of this Resource.
      Overrides:
        `getInputStream` in class `org.apache.tools.ant.types.Resource`
      Returns:
        an InputStream object.
      Throws:
        `java.io.IOException` - if the archive cannot be opened, or the entry cannot be read.

    - #### getOutputStream

          public java.io.OutputStream getOutputStream()
                                               throws java.io.IOException

      Get an OutputStream for the Resource.
      Overrides:
        `getOutputStream` in class `org.apache.tools.ant.types.Resource`
      Returns:
        an OutputStream to which content can be written.
      Throws:
        `java.io.IOException` - if unable to provide the content of this Resource as a stream.
        `java.lang.UnsupportedOperationException` - if OutputStreams are not supported for this Resource type.

    - #### getUid

          public int getUid()

      Returns:
        the uid for the entry

    - #### getGid

          public int getGid()

      Returns:
        the gid for the entry

    - #### fetchEntry

          protected void fetchEntry()

      fetches information from the named entry inside the archive.
      Specified by:
        `fetchEntry` in class `org.apache.tools.ant.types.resources.ArchiveResource`

    - #### setEntry

          protected void setEntry(org.apache.commons.compress.archivers.ArchiveEntry e)