public class ZipSplitter extends java.lang.Object implements Splitter<BytesHandle>
Modifier and Type | Class and Description |
---|---|
static interface |
ZipSplitter.UriMaker
UriMaker which generates URI for each split
file
|
Constructor and Description |
---|
ZipSplitter()
Create a new ZIP splitter.
|
Modifier and Type | Method and Description |
---|---|
long |
getCount()
Returns the number of splits.
|
java.util.function.Predicate<java.util.zip.ZipEntry> |
getEntryFilter()
Returns the entryFilter set to splitter.
|
java.util.Map<java.lang.String,Format> |
getExtensionFormats()
Returns the extensionFormats set to
splitter.
|
ZipSplitter.UriMaker |
getUriMaker()
Get the UriMaker of the splitter
|
java.util.function.Function<java.lang.String,java.lang.String> |
getUriTransformer()
Returns the uriTransformer set to
splitter.
|
void |
setEntryFilter(java.util.function.Predicate<java.util.zip.ZipEntry> entryFilter)
Used to set entryFilter to splitter.
|
void |
setUriMaker(ZipSplitter.UriMaker uriMaker)
Set the UriMaker to the splitter
|
void |
setUriTransformer(java.util.function.Function<java.lang.String,java.lang.String> uriTransformer)
Used to set uriTransformer to splitter.
|
java.util.stream.Stream<BytesHandle> |
split(java.io.InputStream input)
Takes a input stream of a ZIP file and convert
it to a stream of BytesHandle.
|
java.util.stream.Stream<BytesHandle> |
split(java.util.zip.ZipInputStream input)
Takes a ZipInputStream of a ZIP file and convert
it to a stream of BytesHandle.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.io.InputStream input)
Takes a input stream of a ZIP file and convert
it to a stream of DocumentWriteOperation.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.io.InputStream input,
java.lang.String splitFilename)
Takes a input stream and name of a ZIP file and
convert it to a stream of DocumentWriteOperation.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.util.zip.ZipInputStream input)
Takes a ZipInputStream of a ZIP file and convert
it to a stream of DocumentWriteOperation.
|
java.util.stream.Stream<DocumentWriteOperation> |
splitWriteOperations(java.util.zip.ZipInputStream input,
java.lang.String splitFilename)
Takes a ZipInputStream and name of a ZIP file
and convert it to a stream of DocumentWriteOperation.
|
public java.util.Map<java.lang.String,Format> getExtensionFormats()
public java.util.function.Predicate<java.util.zip.ZipEntry> getEntryFilter()
public void setEntryFilter(java.util.function.Predicate<java.util.zip.ZipEntry> entryFilter)
entryFilter
- the filter that applied to each
zipEntrypublic java.util.function.Function<java.lang.String,java.lang.String> getUriTransformer()
public void setUriTransformer(java.util.function.Function<java.lang.String,java.lang.String> uriTransformer)
uriTransformer
- the uriTransformer which applied
on each document URIpublic long getCount()
getCount
in interface Splitter<BytesHandle>
public java.util.stream.Stream<BytesHandle> split(java.io.InputStream input) throws java.io.IOException
split
in interface Splitter<BytesHandle>
input
- is the incoming input streamjava.io.IOException
- if input cannot be
splitpublic java.util.stream.Stream<BytesHandle> split(java.util.zip.ZipInputStream input) throws java.io.IOException
input
- is a ZipInputStream of a zip filejava.io.IOException
- if input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.io.InputStream input) throws java.lang.Exception
splitWriteOperations
in
interface Splitter<BytesHandle>
input
- is the incoming input stream.java.lang.Exception
- if the input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.io.InputStream input, java.lang.String splitFilename) throws java.lang.Exception
splitWriteOperations
in
interface Splitter<BytesHandle>
input
- is the incoming input stream.splitFilename
- is the input file name, including
name and extension. It is used to generate URLs for split files.The
splitFilename could either be provided here or in user-defined
UriMaker.java.lang.Exception
- if the input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.util.zip.ZipInputStream input) throws java.io.IOException
input
- is a ZipInputStream of a zip filejava.io.IOException
- if input cannot be
splitpublic java.util.stream.Stream<DocumentWriteOperation> splitWriteOperations(java.util.zip.ZipInputStream input, java.lang.String splitFilename) throws java.io.IOException
input
- is a ZipInputStream of a zip filesplitFilename
- is the file name of input file,
including name and extension. It is used to generate URLs for split
files.The splitFilename could either be provided here or in
user-defined UriMaker.java.io.IOException
- if input cannot be
splitpublic ZipSplitter.UriMaker getUriMaker()
public void setUriMaker(ZipSplitter.UriMaker uriMaker)
uriMaker
- the uriMaker to generate URI of each
split file.Copyright © 2024 MarkLogic Corporation. All Rights Reserved.