Class Tbz2Format

  • All Implemented Interfaces:
    ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>

    public final class Tbz2Format
    extends BaseFormat
    implements ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
    bzip2-compressed tarball (tar.bz2) format.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.List<java.lang.String> SUFFIXES  
      private ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream> tarFormat  
    • Constructor Summary

      Constructors 
      Constructor Description
      Tbz2Format()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.commons.compress.archivers.ArchiveOutputStream createArchiveOutputStream​(java.io.OutputStream s)
      Start a new archive.
      org.apache.commons.compress.archivers.ArchiveOutputStream createArchiveOutputStream​(java.io.OutputStream s, java.util.Map<java.lang.String,​java.lang.Object> o)
      Start a new archive.
      boolean equals​(java.lang.Object other)
      int hashCode()
      void putEntry​(org.apache.commons.compress.archivers.ArchiveOutputStream out, ObjectId tree, java.lang.String path, FileMode mode, ObjectLoader loader)
      Write an entry to an archive.
      java.lang.Iterable<java.lang.String> suffixes()
      Filename suffixes representing this format (e.g., { ".tar.gz", ".tgz" }).
      • Methods inherited from class java.lang.Object

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

      • SUFFIXES

        private static final java.util.List<java.lang.String> SUFFIXES
      • tarFormat

        private final ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream> tarFormat
    • Constructor Detail

      • Tbz2Format

        public Tbz2Format()
    • Method Detail

      • createArchiveOutputStream

        public org.apache.commons.compress.archivers.ArchiveOutputStream createArchiveOutputStream​(java.io.OutputStream s)
                                                                                            throws java.io.IOException
        Start a new archive. Entries can be included in the archive using the putEntry method, and then the archive should be closed using its close method.
        Specified by:
        createArchiveOutputStream in interface ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
        Parameters:
        s - underlying output stream to which to write the archive.
        Returns:
        new archive object for use in putEntry
        Throws:
        java.io.IOException - thrown by the underlying output stream for I/O errors
      • createArchiveOutputStream

        public org.apache.commons.compress.archivers.ArchiveOutputStream createArchiveOutputStream​(java.io.OutputStream s,
                                                                                                   java.util.Map<java.lang.String,​java.lang.Object> o)
                                                                                            throws java.io.IOException
        Start a new archive. Entries can be included in the archive using the putEntry method, and then the archive should be closed using its close method. In addition options can be applied to the underlying stream. E.g. compression level.
        Specified by:
        createArchiveOutputStream in interface ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
        Parameters:
        s - underlying output stream to which to write the archive.
        o - options to apply to the underlying output stream. Keys are option names and values are option values.
        Returns:
        new archive object for use in putEntry
        Throws:
        java.io.IOException - thrown by the underlying output stream for I/O errors
      • putEntry

        public void putEntry​(org.apache.commons.compress.archivers.ArchiveOutputStream out,
                             ObjectId tree,
                             java.lang.String path,
                             FileMode mode,
                             ObjectLoader loader)
                      throws java.io.IOException
        Write an entry to an archive.
        Specified by:
        putEntry in interface ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
        Parameters:
        out - archive object from createArchiveOutputStream
        tree - the tag, commit, or tree object to produce an archive for
        path - full filename relative to the root of the archive (with trailing '/' for directories)
        mode - mode (for example FileMode.REGULAR_FILE or FileMode.SYMLINK)
        loader - blob object with data for this entry (null for directories)
        Throws:
        java.io.IOException - thrown by the underlying output stream for I/O errors
      • suffixes

        public java.lang.Iterable<java.lang.String> suffixes()
        Filename suffixes representing this format (e.g., { ".tar.gz", ".tgz" }). The behavior is undefined when suffixes overlap (if one format claims suffix ".7z", no other format should take ".tar.7z").
        Specified by:
        suffixes in interface ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
        Returns:
        this format's suffixes
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object