Class TarResource

All Implemented Interfaces:
Cloneable, Comparable<Resource>, Iterable<Resource>, ResourceCollection

public class TarResource extends ArchiveResource
A Resource representation of an entry in a tar archive.
Since:
Ant 1.7
  • Constructor Details

    • TarResource

      public TarResource()
      Default constructor.
    • TarResource

      public TarResource(File a, TarEntry e)
      Construct a TarResource representing the specified entry in the specified archive.
      Parameters:
      a - the archive as File.
      e - the TarEntry.
    • TarResource

      public TarResource(Resource a, TarEntry e)
      Construct a TarResource representing the specified entry in the specified archive.
      Parameters:
      a - the archive as Resource.
      e - the TarEntry.
  • Method Details

    • getInputStream

      public InputStream getInputStream() throws IOException
      Return an InputStream for reading the contents of this Resource.
      Overrides:
      getInputStream in class Resource
      Returns:
      an InputStream object.
      Throws:
      IOException - if the tar file cannot be opened, or the entry cannot be read.
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Get an OutputStream for the Resource.
      Overrides:
      getOutputStream in class Resource
      Returns:
      an OutputStream to which content can be written.
      Throws:
      IOException - if unable to provide the content of this Resource as a stream.
      UnsupportedOperationException - if OutputStreams are not supported for this Resource type.
    • getUserName

      public String getUserName()
      Returns:
      the user name for the tar entry
    • getGroup

      public String getGroup()
      Returns:
      the group name for the tar entry
    • getLongUid

      public long getLongUid()
      Returns:
      the uid for the tar entry
      Since:
      1.10.4
    • getUid

      @Deprecated public int getUid()
      Deprecated.
      Returns:
      the uid for the tar entry
    • getLongGid

      public long getLongGid()
      Returns:
      the gid for the tar entry
      Since:
      1.10.4
    • getGid

      @Deprecated public int getGid()
      Deprecated.
      Returns:
      the uid for the tar entry
    • getLinkName

      public String getLinkName()
      Returns:
      the link "name" (=path) of this entry; an empty string if this is no link
      Since:
      1.10.12
    • getLinkFlag

      public byte getLinkFlag()
      Returns:
      the link "flag" (=type) of this entry
      Since:
      1.10.12
    • fetchEntry

      protected void fetchEntry()
      fetches information from the named entry inside the archive.
      Specified by:
      fetchEntry in class ArchiveResource
    • getRef

      protected TarResource getRef()
      Description copied from class: Resource
      Perform the check for circular references and return the referenced Resource.
      Overrides:
      getRef in class ArchiveResource
      Returns:
      Resource.