public interface ArchiveFormat
ArchiveFormatFactory.| Modifier and Type | Method and Description |
|---|---|
org.apache.commons.compress.archivers.ArchiveInputStream |
archiveInputStream(java.io.InputStream is) |
org.apache.commons.compress.archivers.ArchiveOutputStream |
archiveOutputStream(java.io.OutputStream os) |
org.apache.commons.compress.archivers.ArchiveOutputStream |
create(java.io.File archiveFile)
Creates a new archive file.
|
java.lang.String |
getArchiveFileName(java.lang.String fileName)
Maps the given
fileName to the name that a corresponding archive file would have. |
java.lang.String |
getName() |
boolean |
isArchiveFileName(java.lang.String fileName) |
boolean |
matches(byte[] signature,
int signatureLength) |
org.apache.commons.compress.archivers.ArchiveInputStream |
open(java.io.File archiveFile)
Opens an existing archive file for reading.
|
void |
writeDirectoryEntry(org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
java.lang.String name)
Appends a 'directory entry', i.e. an entry without contents, to the given
archiveOutputStream. |
void |
writeEntry(org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
org.apache.commons.compress.archivers.ArchiveEntry archiveEntry,
java.lang.String name,
ConsumerWhichThrows<? super java.io.OutputStream,? extends java.io.IOException> writeContents)
Appends the given
archiveEntry with the given contents to the given archiveOutputStream. |
void |
writeEntry(org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
java.lang.String name,
ConsumerWhichThrows<? super java.io.OutputStream,? extends java.io.IOException> writeContents)
Appends a 'normal' entry (as opposed to a 'directory entry') with the given contents to the given
archiveOutputStream. |
java.lang.String getName()
boolean isArchiveFileName(java.lang.String fileName)
fileName is typical for this ArchiveFormatjava.lang.String getArchiveFileName(java.lang.String fileName)
fileName to the name that a corresponding archive file would have. This is typically
achieved by appending a suffix, like '.7z', '.zip', '.tar'.org.apache.commons.compress.archivers.ArchiveInputStream archiveInputStream(java.io.InputStream is)
throws org.apache.commons.compress.archivers.StreamingNotSupportedException,
org.apache.commons.compress.archivers.ArchiveException
ArchiveInputStream for this format which reads from the given
input streamorg.apache.commons.compress.archivers.StreamingNotSupportedException - This archive format does not support streamingorg.apache.commons.compress.archivers.ArchiveException - The contents is invalid for this archive formatorg.apache.commons.compress.archivers.ArchiveInputStream open(java.io.File archiveFile)
throws java.io.IOException,
org.apache.commons.compress.archivers.ArchiveException
ArchiveInputStream for this format which reads from the given archiveFilejava.io.IOExceptionorg.apache.commons.compress.archivers.ArchiveExceptionorg.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream(java.io.OutputStream os)
throws org.apache.commons.compress.archivers.StreamingNotSupportedException,
org.apache.commons.compress.archivers.ArchiveException
ArchiveOutputStream for this format which writes to the given
output streamorg.apache.commons.compress.archivers.StreamingNotSupportedException - This archive format does not support streamingorg.apache.commons.compress.archivers.ArchiveException - Creation of archives in in this format is not supportedorg.apache.commons.compress.archivers.ArchiveOutputStream create(java.io.File archiveFile)
throws java.io.IOException,
org.apache.commons.compress.archivers.ArchiveException
ArchiveOutputStream for this format which writes to the given archiveFileorg.apache.commons.compress.archivers.ArchiveException - Creation of archives in this format is not supportedjava.io.IOExceptionvoid writeEntry(org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
java.lang.String name,
ConsumerWhichThrows<? super java.io.OutputStream,? extends java.io.IOException> writeContents)
throws java.io.IOException
archiveOutputStream. The archive entry is filled with "standard values", except for the entry name.
writeContents is called exactly once unless the name designates a directory entry
archiveOutputStream - Must match this ArchiveFormatname - The name for the entry; may be slightly changed (in particulary wrt/ leading
and trailing slashes) before the entry is createdwriteContents - Writes the entry's contents to the 'subject' output streamjava.lang.IllegalArgumentException - The type of the archiveOutputStream does not match this ArchiveFormatjava.io.IOExceptionwriteDirectoryEntry(ArchiveOutputStream, String)void writeDirectoryEntry(org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
java.lang.String name)
throws java.io.IOException
archiveOutputStream. The
archive entry is filled with "standard values", except for the entry name.archiveOutputStream - Must match this ArchiveFormatname - The name for the entry; may be slightly changed (in particulary wrt/
leading and trailing slashes) before the entry is createdjava.lang.IllegalArgumentException - The type of the archiveOutputStream does not match this ArchiveFormatjava.lang.UnsupportedOperationException - This archive format does not support 'directory entries'java.io.IOExceptionvoid writeEntry(org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
org.apache.commons.compress.archivers.ArchiveEntry archiveEntry,
@Nullable
java.lang.String name,
ConsumerWhichThrows<? super java.io.OutputStream,? extends java.io.IOException> writeContents)
throws java.io.IOException
archiveEntry with the given contents to the given archiveOutputStream. If
name is not null, then it overrides the name in the archive entry.
If the type of the archiveEntry does not match this ArchiveFormat, then it is automatically
converted to the correct type, preserving as much information as possible ('re-archiving').
writeContents is called exactly once unless the archiveEntry is a directory entry.
archiveOutputStream - Must match this ArchiveFormatarchiveEntry - May or may not match this ArchiveFormat (see above)name - Overrides the name in the archiveEntry, or nullwriteContents - Writes the entry's contents to the 'subject' output streamjava.lang.IllegalArgumentException - The type of the archiveOutputStream does not match this ArchiveFormatjava.io.IOExceptionboolean matches(byte[] signature,
int signatureLength)