Package org.eclipse.jgit.archive
Class TgzFormat
java.lang.Object
org.eclipse.jgit.archive.BaseFormat
org.eclipse.jgit.archive.TgzFormat
- All Implemented Interfaces:
ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
public final class TgzFormat
extends BaseFormat
implements ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
gzip-compressed tarball (tar.gz) format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
Fields inherited from class org.eclipse.jgit.archive.BaseFormat
COMPRESSION_LEVEL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.compress.archivers.ArchiveOutputStream
Start a new archive.org.apache.commons.compress.archivers.ArchiveOutputStream
Start a new archive.boolean
int
hashCode()
void
putEntry
(org.apache.commons.compress.archivers.ArchiveOutputStream out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) Write an entry to an archive.suffixes()
Filename suffixes representing this format (e.g., { ".tar.gz", ".tgz" }).Methods inherited from class org.eclipse.jgit.archive.BaseFormat
applyFormatOptions, getCompressionLevel
-
Field Details
-
SUFFIXES
-
tarFormat
private final ArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream> tarFormat
-
-
Constructor Details
-
TgzFormat
public TgzFormat()
-
-
Method Details
-
createArchiveOutputStream
public org.apache.commons.compress.archivers.ArchiveOutputStream createArchiveOutputStream(OutputStream s) throws 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 interfaceArchiveCommand.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:
IOException
- thrown by the underlying output stream for I/O errors
-
createArchiveOutputStream
public org.apache.commons.compress.archivers.ArchiveOutputStream createArchiveOutputStream(OutputStream s, Map<String, Object> o) throws IOExceptionStart 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 interfaceArchiveCommand.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:
IOException
- thrown by the underlying output stream for I/O errors
-
putEntry
public void putEntry(org.apache.commons.compress.archivers.ArchiveOutputStream out, ObjectId tree, String path, FileMode mode, ObjectLoader loader) throws IOException Write an entry to an archive.- Specified by:
putEntry
in interfaceArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
- Parameters:
out
- archive object from createArchiveOutputStreamtree
- the tag, commit, or tree object to produce an archive forpath
- 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:
IOException
- thrown by the underlying output stream for I/O errors
-
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 interfaceArchiveCommand.Format<org.apache.commons.compress.archivers.ArchiveOutputStream>
- Returns:
- this format's suffixes
-
equals
-
hashCode
public int hashCode()
-