|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.file.contentstransformation.ContentsTransformations
public final class ContentsTransformations
Utility class for ContentsTransformer.
| Field Summary | |
|---|---|
static ContentsTransformer |
COPY
A ContentsTransformer which IoUtil.copy(InputStream, OutputStream)s all data unmodified and
returns the number of copied bytes. |
| Method Summary | |
|---|---|
static CompressUtil.ArchiveHandler<java.lang.Void> |
archiveHandler(java.lang.String path,
java.io.OutputStream os,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
ContentsTransformer contentsTransformer,
FileTransformations.ArchiveCombiner archiveFileCombiner,
ExceptionHandler<java.io.IOException> exceptionHandler)
Creates and returns an CompressUtil.ArchiveHandler which transforms ArchiveInputStreams into ArchiveOutputStreams, honoring the given archiveEntryRemoval, archiveEntryRenaming and archiveEntryAddition, and using the given contentsTransformer. |
static ContentsTransformer |
compressedAndArchiveContentsTransformer(Predicate<java.lang.String> lookIntoFormat,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
ContentsTransformer archiveEntryContentsTransformer,
FileTransformations.ArchiveCombiner archiveCombiner,
ContentsTransformer compressedContentsTransformer,
ContentsTransformer normalContentsTransformer,
ExceptionHandler<java.io.IOException> exceptionHandler)
Returns a ContentsTransformer which transforms contents by feeding it through the normalContentsTransformer, 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 CompressUtil.CompressorHandler<java.lang.Void> |
compressorHandler(java.lang.String path,
java.io.OutputStream os,
ContentsTransformer contentsTransformer)
Creates and returns a CompressUtil.CompressorHandler which transforms an ArchiveInputStream into an OutputStream, using the given contentsTransformer. |
static CompressUtil.NormalContentsHandler<java.lang.Void> |
normalContentsHandler(java.lang.String path,
java.io.OutputStream os,
ContentsTransformer contentsTransformer)
Creates and returns a handler which transforms an InputStream into an OutputStream using the
given contentsTransformer. |
static ContentsTransformer |
recursiveCompressedAndArchiveContentsTransformer(Predicate<java.lang.String> lookIntoFormat,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
FileTransformations.ArchiveCombiner archiveCombiner,
ContentsTransformer delegate,
ExceptionHandler<java.io.IOException> exceptionHandler)
Returns a ContentsTransformer which transforms a stream by feeding it through the delegate, 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. |
static void |
transformArchive(java.lang.String path,
org.apache.commons.compress.archivers.ArchiveInputStream archiveInputStream,
org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
ContentsTransformer contentsTransformer,
FileTransformations.ArchiveCombiner archiveCombiner,
ExceptionHandler<java.io.IOException> exceptionHandler)
Transforms the given archiveInputStream into the given archiveOutputStream, honoring the given
archiveEntryRemoval, archiveEntryRenaming and archiveEntryAddition, and using the given
contentsTransformer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ContentsTransformer COPY
ContentsTransformer which IoUtil.copy(InputStream, OutputStream)s all data unmodified and
returns the number of copied bytes.
| Method Detail |
|---|
public static ContentsTransformer compressedAndArchiveContentsTransformer(Predicate<java.lang.String> lookIntoFormat,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
ContentsTransformer archiveEntryContentsTransformer,
FileTransformations.ArchiveCombiner archiveCombiner,
ContentsTransformer compressedContentsTransformer,
ContentsTransformer normalContentsTransformer,
ExceptionHandler<java.io.IOException> exceptionHandler)
ContentsTransformer which transforms contents by feeding it through the normalContentsTransformer, 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 ContentsTransformer recursiveCompressedAndArchiveContentsTransformer(Predicate<java.lang.String> lookIntoFormat,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
FileTransformations.ArchiveCombiner archiveCombiner,
ContentsTransformer delegate,
ExceptionHandler<java.io.IOException> exceptionHandler)
ContentsTransformer which transforms a stream by feeding it through the delegate, 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 void transformArchive(java.lang.String path,
org.apache.commons.compress.archivers.ArchiveInputStream archiveInputStream,
org.apache.commons.compress.archivers.ArchiveOutputStream archiveOutputStream,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
ContentsTransformer contentsTransformer,
FileTransformations.ArchiveCombiner archiveCombiner,
ExceptionHandler<java.io.IOException> exceptionHandler)
throws java.io.IOException
archiveInputStream into the given archiveOutputStream, honoring the given
archiveEntryRemoval, archiveEntryRenaming and archiveEntryAddition, and using the given
contentsTransformer.
java.io.IOException
public static CompressUtil.ArchiveHandler<java.lang.Void> archiveHandler(java.lang.String path,
java.io.OutputStream os,
Predicate<java.lang.String> archiveEntryRemoval,
Glob archiveEntryRenaming,
ContentsTransformer contentsTransformer,
FileTransformations.ArchiveCombiner archiveFileCombiner,
ExceptionHandler<java.io.IOException> exceptionHandler)
CompressUtil.ArchiveHandler which transforms ArchiveInputStreams into ArchiveOutputStreams, honoring the given archiveEntryRemoval, archiveEntryRenaming and archiveEntryAddition, and using the given contentsTransformer.
public static CompressUtil.CompressorHandler<java.lang.Void> compressorHandler(java.lang.String path,
java.io.OutputStream os,
ContentsTransformer contentsTransformer)
CompressUtil.CompressorHandler which transforms an ArchiveInputStream into an OutputStream, using the given contentsTransformer.
public static CompressUtil.NormalContentsHandler<java.lang.Void> normalContentsHandler(java.lang.String path,
java.io.OutputStream os,
ContentsTransformer contentsTransformer)
InputStream into an OutputStream using the
given contentsTransformer.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||