|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.file.contentsprocessing.ContentsProcessings
public final class ContentsProcessings
ContentsProcessor-related utility methods.
| Nested Class Summary | |
|---|---|
static interface |
ContentsProcessings.ArchiveCombiner<T>
Combines the results of ContentsProcessor.process(String, InputStream, long, long, ProducerWhichThrows)
for all archive entries into one object. |
| Method Summary | ||
|---|---|---|
static
|
archiveHandler(java.lang.String path,
ContentsProcessor<T> contentsProcessor,
ContentsProcessings.ArchiveCombiner<T> archiveEntryCombiner,
ProducerWhichThrows<java.io.InputStream,java.io.IOException> opener,
ExceptionHandler<java.io.IOException> exceptionHandler)
Creates and returns an CompressUtil.ArchiveHandler which processes ArchiveInputStreams by feeding their
entries into the contentsProcessor. |
|
static
|
compressedAndArchiveContentsProcessor(Predicate<java.lang.String> lookIntoFormat,
ContentsProcessor<T> archiveContentsProcessor,
ContentsProcessings.ArchiveCombiner<T> archiveEntryCombiner,
ContentsProcessor<T> compressedContentsProcessor,
ContentsProcessor<T> normalContentsProcessor,
ExceptionHandler<java.io.IOException> exceptionHandler)
Returns a ContentsProcessor which processes contents by feeding it to the normalContentsProcessor, but automagically detects various archive and compression formats and processes the
entries of the archive and the uncompressed contents instead of the "raw" contents. |
|
static
|
compressorHandler(java.lang.String path,
ContentsProcessor<T> contentsProcessor,
ProducerWhichThrows<java.io.InputStream,java.io.IOException> opener)
Creates and returns a CompressUtil.CompressorHandler which processes an ArchiveInputStream by feeding its
entries to the given contentsProcessor. |
|
static
|
nopArchiveCombiner()
|
|
static
|
nopContentsProcessor()
|
|
static
|
normalContentsHandler(java.lang.String path,
ContentsProcessor<T> contentsProcessor,
long size,
long crc32,
ProducerWhichThrows<java.io.InputStream,java.io.IOException> opener)
Creates and returns a TransformerWhichThrows which processes an InputStream by feeding it into
the given contentsProcessor. |
|
static
|
processArchive(java.lang.String archivePath,
org.apache.commons.compress.archivers.ArchiveInputStream archiveInputStream,
ContentsProcessor<T> contentsProcessor,
ContentsProcessings.ArchiveCombiner<T> entryCombiner,
ProducerWhichThrows<org.apache.commons.compress.archivers.ArchiveInputStream,java.io.IOException> archiveOpener,
ExceptionHandler<java.io.IOException> exceptionHandler)
Process the given archiveInputStream by feeding the contents of each archive entry through the given
contentsProcessor. |
|
static
|
recursiveCompressedAndArchiveContentsProcessor(Predicate<java.lang.String> lookIntoFormat,
ContentsProcessings.ArchiveCombiner<T> archiveEntryCombiner,
ContentsProcessor<T> normalContentsProcessor,
ExceptionHandler<java.io.IOException> exceptionHandler)
Returns a ContentsProcessor which processes a stream by feeding it into the normalContentsProcessor, but automagically detects various archive formats and compression formats (also
nested) and processes the entries of the archive and the uncompressed contents instead of the
"raw" contents. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> ContentsProcessor<T> nopContentsProcessor()
ContentsProcessor that does not read any of the contents.public static <T> ContentsProcessings.ArchiveCombiner<T> nopArchiveCombiner()
ContentsProcessings.ArchiveCombiner which always returns null
@Nullable
public static <T> T processArchive(java.lang.String archivePath,
org.apache.commons.compress.archivers.ArchiveInputStream archiveInputStream,
ContentsProcessor<T> contentsProcessor,
ContentsProcessings.ArchiveCombiner<T> entryCombiner,
ProducerWhichThrows<org.apache.commons.compress.archivers.ArchiveInputStream,java.io.IOException> archiveOpener,
ExceptionHandler<java.io.IOException> exceptionHandler)
throws java.io.IOException
archiveInputStream by feeding the contents of each archive entry through the given
contentsProcessor.
exceptionHandler - Invoked if the contentsProcessor throws an exception; if it completes normally,
then processing continues with the next archive entry
java.io.IOException
public static <T> ContentsProcessor<T> compressedAndArchiveContentsProcessor(Predicate<java.lang.String> lookIntoFormat,
ContentsProcessor<T> archiveContentsProcessor,
ContentsProcessings.ArchiveCombiner<T> archiveEntryCombiner,
ContentsProcessor<T> compressedContentsProcessor,
ContentsProcessor<T> normalContentsProcessor,
ExceptionHandler<java.io.IOException> exceptionHandler)
ContentsProcessor which processes contents by feeding it to the normalContentsProcessor, but automagically detects various archive and compression formats and processes the
entries of the archive and the uncompressed contents instead of the "raw" contents.
Archive files and compressed files are introspected iff lookIntoFormat evaluates true for
"format:path".
public static <T> ContentsProcessor<T> recursiveCompressedAndArchiveContentsProcessor(Predicate<java.lang.String> lookIntoFormat,
ContentsProcessings.ArchiveCombiner<T> archiveEntryCombiner,
ContentsProcessor<T> normalContentsProcessor,
ExceptionHandler<java.io.IOException> exceptionHandler)
ContentsProcessor which processes a stream by feeding it into the normalContentsProcessor, but automagically detects various archive formats and compression formats (also
nested) and processes the entries of the archive and the uncompressed contents instead of the
"raw" contents.
Archive streams/entries and compressed streams/entries are introspected iff lookIntoFormat evaluates
true for "format:path".
public static <T> CompressUtil.ArchiveHandler<T> archiveHandler(java.lang.String path,
ContentsProcessor<T> contentsProcessor,
ContentsProcessings.ArchiveCombiner<T> archiveEntryCombiner,
ProducerWhichThrows<java.io.InputStream,java.io.IOException> opener,
ExceptionHandler<java.io.IOException> exceptionHandler)
CompressUtil.ArchiveHandler which processes ArchiveInputStreams by feeding their
entries into the contentsProcessor.
opener - TODO
public static <T> CompressUtil.CompressorHandler<T> compressorHandler(java.lang.String path,
ContentsProcessor<T> contentsProcessor,
ProducerWhichThrows<java.io.InputStream,java.io.IOException> opener)
CompressUtil.CompressorHandler which processes an ArchiveInputStream by feeding its
entries to the given contentsProcessor.
opener - Re-produces the input stream
public static <T> CompressUtil.NormalContentsHandler<T> normalContentsHandler(java.lang.String path,
ContentsProcessor<T> contentsProcessor,
long size,
long crc32,
ProducerWhichThrows<java.io.InputStream,java.io.IOException> opener)
TransformerWhichThrows which processes an InputStream by feeding it into
the given contentsProcessor.
size - -1 if unknowncrc32 - TODOopener - Re-produces the
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||