Class TarArchive

  • All Implemented Interfaces:
    org.apache.commons.compress.Archive

    public class TarArchive
    extends org.apache.commons.compress.AbstractArchive
    Archive-Implementation for Tar. An tar archive has no header. This means, that the ArchiverFactory.getInstance( new File("file.tar")) Method cannot be used.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String ARCHIVER_NAME
      ARCHIVER_NAME Field for this archiver.
      private static int BUFFER  
      static java.lang.String DEFAULT_FILE_EXTENSION
      DEFAULT_FILE_EXTENSION Field for this archiver.
      • Fields inherited from class org.apache.commons.compress.PackableObject

        CHOOSE_EXTENSION, CHOOSE_NAME
    • Constructor Summary

      Constructors 
      Constructor Description
      TarArchive()
      This Archive should be instantiated in the Archive-Interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doSave​(java.io.OutputStream output)
      Specific implementation of the save opteration.
      protected void doUnpack​(java.io.File unpackDir)
      Specific implementation of the unpack opteration.
      java.lang.String getDefaultFileExtension()
      Returns the default FileExtension for this archive, for example "zip", "tar"...
      byte[] getHeader()
      Header byte array for this archive.
      java.lang.String getName()
      Returns the ArchiveName for this archive.
      • Methods inherited from class org.apache.commons.compress.AbstractArchive

        add, add, close, getArchive, getEntryIterator, save, save, setArchive, unpack
      • Methods inherited from class org.apache.commons.compress.PackableObject

        identifyByHeader, isPackableWith
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_FILE_EXTENSION

        public static final java.lang.String DEFAULT_FILE_EXTENSION
        DEFAULT_FILE_EXTENSION Field for this archiver.
        See Also:
        Constant Field Values
      • ARCHIVER_NAME

        private static final java.lang.String ARCHIVER_NAME
        ARCHIVER_NAME Field for this archiver.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TarArchive

        public TarArchive()
        This Archive should be instantiated in the Archive-Interface.
    • Method Detail

      • doUnpack

        protected void doUnpack​(java.io.File unpackDir)
                         throws org.apache.commons.compress.UnpackException
        Description copied from class: org.apache.commons.compress.AbstractArchive
        Specific implementation of the unpack opteration.
        Specified by:
        doUnpack in class org.apache.commons.compress.AbstractArchive
        Parameters:
        unpackDir - dir, to unpack to
        Throws:
        org.apache.commons.compress.UnpackException
      • doSave

        public void doSave​(java.io.OutputStream output)
                    throws org.apache.commons.compress.ArchiveException
        Description copied from class: org.apache.commons.compress.AbstractArchive
        Specific implementation of the save opteration.
        Specified by:
        doSave in class org.apache.commons.compress.AbstractArchive
        Parameters:
        output - - stream to archive to
        Throws:
        org.apache.commons.compress.ArchiveException
      • getName

        public java.lang.String getName()
        Description copied from class: org.apache.commons.compress.PackableObject
        Returns the ArchiveName for this archive.
        Specified by:
        getName in class org.apache.commons.compress.PackableObject
      • getDefaultFileExtension

        public java.lang.String getDefaultFileExtension()
        Description copied from class: org.apache.commons.compress.PackableObject
        Returns the default FileExtension for this archive, for example "zip", "tar"...
        Specified by:
        getDefaultFileExtension in class org.apache.commons.compress.PackableObject
      • getHeader

        public byte[] getHeader()
        Description copied from class: org.apache.commons.compress.PackableObject
        Header byte array for this archive.
        Specified by:
        getHeader in class org.apache.commons.compress.PackableObject