|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.file.org.apache.commons.compress.compressors.CompressionFormatFactory
public abstract class CompressionFormatFactory
Manages CompressionFormats.
Additional compression formats can be 'plugged in' at runtime by putting a resource named FORMATS_RESOURCE
on the
classpath.
| Method Summary | |
|---|---|
static java.util.Collection<CompressionFormat> |
allFormats()
|
static org.apache.commons.compress.compressors.CompressorInputStream |
compressorInputStream(java.io.InputStream inputStream)
Determines the compression format from the first few bytes of the inputStream and then wraps it in the
appropriate CompressorInputStream. |
static CompressionFormat |
forCompressorOutputStream(org.apache.commons.compress.compressors.CompressorOutputStream compressorOutputStream)
Deprecated. Should be replaced by a new method CompressorOutputStream.getFormat() |
static CompressionFormat |
forContents(java.io.File file)
Reads the first few bytes from the given file and determines the compression format. |
static CompressionFormat |
forContents(java.io.InputStream is)
Reads the first few bytes from the given input stream and determines the compression format. |
static CompressionFormat |
forFileName(java.lang.String fileName)
|
static CompressionFormat |
forFormatName(java.lang.String compressionFormatName)
|
static long |
getUncompressedSize(org.apache.commons.compress.compressors.CompressorInputStream compressorInputStream)
Deprecated. Should be replaced by a new method CompressorInputStream.getUncompressedSize() |
static org.apache.commons.compress.compressors.CompressorInputStream |
open(java.io.File compressedFile)
Determines the compression format from the first few bytes of the compressedFile and then returns a
CompressorInputStream reading from the compressedFile. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.util.Collection<CompressionFormat> allFormats()
@Nullable public static CompressionFormat forFileName(java.lang.String fileName)
CompressionFormat for the given file name, or null iff a compression format cannot
be deduced from the fileNameFileNameUtil.isCompressedFilename(String)
public static CompressionFormat forFormatName(java.lang.String compressionFormatName)
throws org.apache.commons.compress.compressors.CompressorException
CompressionFormat for the given compressionFormatName
org.apache.commons.compress.compressors.CompressorException - The compressionFormatName is unknown
@Nullable
public static CompressionFormat forContents(java.io.InputStream is)
throws java.io.IOException
allFormats(), or null iff the stream contents has none of the known
compression formats
java.io.IOException
@Nullable
public static CompressionFormat forContents(java.io.File file)
throws java.io.IOException
allFormats(), or null iff the file contents has none of the known
compression formats
java.io.IOException@Deprecated public static CompressionFormat forCompressorOutputStream(org.apache.commons.compress.compressors.CompressorOutputStream compressorOutputStream)
CompressorOutputStream.getFormat()
compressorOutputStream@Deprecated public static long getUncompressedSize(org.apache.commons.compress.compressors.CompressorInputStream compressorInputStream)
CompressorInputStream.getUncompressedSize()
public static org.apache.commons.compress.compressors.CompressorInputStream compressorInputStream(java.io.InputStream inputStream)
throws java.io.IOException,
org.apache.commons.compress.compressors.CompressorException
inputStream and then wraps it in the
appropriate CompressorInputStream.
java.io.IOException
org.apache.commons.compress.compressors.CompressorException
public static org.apache.commons.compress.compressors.CompressorInputStream open(java.io.File compressedFile)
throws java.io.IOException,
org.apache.commons.compress.compressors.CompressorException
compressedFile and then returns a
CompressorInputStream reading from the compressedFile.
Is typically faster than CompressionFormatFactory.forContents(compressedFile).compressorInputStream(compressedFile).
java.io.IOException
org.apache.commons.compress.compressors.CompressorException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||