Class UnpackConfig
java.lang.Object
org.apache.tika.pipes.core.extractor.UnpackConfig
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumOutput format for UNPACK mode.static enumOutput mode for how embedded files are delivered.static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault maximum bytes to unpack per file: 10 GB. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()The worker mutates its instance; hand out copies.final booleanNull when the format decides; seewritesMetadata().longMaximum total bytes to unpack per file.Get the output format for UNPACK mode.Get the output mode for how embedded files are delivered.intinthashCode()booleanDeprecated.booleanDeprecated.since 4.1, removal planned for 5.0; seewritesMetadata()booleanbooleanWhether to zip all embedded files into a single archive before emitting.longMaximum total bytes to unpack per file, with -1 (no limit) normalized toLong.MAX_VALUEso callers can bound reads without a special case.voidsetEmbeddedIdPrefix(String embeddedIdPrefix) voidsetEmitKeyBase(String emitKeyBase) voidsetEmitter(String emitter) voidsetIncludeFullMetadata(boolean includeFullMetadata) Deprecated.since 4.1, removal planned for 5.0; usesetIncludeMetadata(Boolean)voidsetIncludeMetadata(Boolean includeMetadata) voidsetIncludeMetadataInZip(boolean includeMetadataInZip) Deprecated.since 4.1, removal planned for 5.0; usesetIncludeMetadata(Boolean)voidsetIncludeOriginal(boolean includeOriginal) voidsetKeyBaseStrategy(String keyBaseStrategy) voidsetKeyBaseStrategy(UnpackConfig.KEY_BASE_STRATEGY keyBaseStrategy) voidsetMaxUnpackBytes(long maxUnpackBytes) voidsetOutputFormat(String outputFormat) voidsetOutputFormat(UnpackConfig.OUTPUT_FORMAT outputFormat) voidsetOutputMode(String outputMode) voidsetOutputMode(UnpackConfig.OUTPUT_MODE outputMode) voidsetSuffixStrategy(String suffixStrategy) voidsetSuffixStrategy(UnpackConfig.SUFFIX_STRATEGY suffixStrategy) voidsetZeroPadName(int zeroPadName) voidsetZipEmbeddedFiles(boolean zipEmbeddedFiles) toString()booleanMetadata for every extracted file:metadata.jsonunder FRICTIONLESS, a sidecar per file under REGULAR zip output, nothing under REGULAR loose output.
-
Field Details
-
DEFAULT_MAX_UNPACK_BYTES
public static final long DEFAULT_MAX_UNPACK_BYTESDefault maximum bytes to unpack per file: 10 GB. Use -1 to disable the limit (not recommended).- See Also:
-
-
Constructor Details
-
UnpackConfig
public UnpackConfig()Create an UnpackConfig with default settings.
-
-
Method Details
-
copy
The worker mutates its instance; hand out copies. -
getZeroPadName
public int getZeroPadName() -
getSuffixStrategy
-
getKeyBaseStrategy
-
getEmbeddedIdPrefix
-
getEmitter
-
isIncludeOriginal
public boolean isIncludeOriginal() -
setZeroPadName
public void setZeroPadName(int zeroPadName) -
setSuffixStrategy
-
setSuffixStrategy
-
setKeyBaseStrategy
-
setKeyBaseStrategy
-
setEmbeddedIdPrefix
-
setEmitter
-
setIncludeOriginal
public void setIncludeOriginal(boolean includeOriginal) -
setEmitKeyBase
-
getEmitKeyBase
-
isZipEmbeddedFiles
public boolean isZipEmbeddedFiles()Whether to zip all embedded files into a single archive before emitting. When true, embedded files are collected during parsing and then zipped and emitted as a single archive after parsing completes. -
setZipEmbeddedFiles
public void setZipEmbeddedFiles(boolean zipEmbeddedFiles) -
getIncludeMetadata
Null when the format decides; seewritesMetadata(). -
setIncludeMetadata
-
writesMetadata
public boolean writesMetadata()Metadata for every extracted file:metadata.jsonunder FRICTIONLESS, a sidecar per file under REGULAR zip output, nothing under REGULAR loose output. Unset means on for FRICTIONLESS, off for REGULAR. Not a bean getter: the class is introspected. -
isIncludeMetadataInZip
Deprecated.since 4.1, removal planned for 5.0; seewritesMetadata() -
setIncludeMetadataInZip
Deprecated.since 4.1, removal planned for 5.0; usesetIncludeMetadata(Boolean) -
getMaxUnpackBytes
public long getMaxUnpackBytes()Maximum total bytes to unpack per file. Default is 10GB. Set to -1 to disable the limit (not recommended). 0 is not "unlimited" -- it means zero bytes, so the very first embedded file's extraction is immediately capped.- Returns:
- max bytes to unpack, or -1 if no limit
-
setMaxUnpackBytes
public void setMaxUnpackBytes(long maxUnpackBytes) -
maxUnpackBytesOrUnlimited
public long maxUnpackBytesOrUnlimited()Maximum total bytes to unpack per file, with -1 (no limit) normalized toLong.MAX_VALUEso callers can bound reads without a special case.Deliberately not named
getMaxUnpackBytesOrUnlimited-- this class is JSON (de)serialized via bean introspection, and a "get"-prefixed method here would be picked up as a phantom property with no matching setter.- Returns:
- max bytes to unpack, or
Long.MAX_VALUEif unlimited
-
getOutputFormat
Get the output format for UNPACK mode. REGULAR is the default (existing behavior). FRICTIONLESS creates a Frictionless Data Package with datapackage.json manifest. -
setOutputFormat
-
setOutputFormat
-
getOutputMode
Get the output mode for how embedded files are delivered. ZIPPED packages all files into a single zip archive. DIRECTORY emits files directly to the configured emitter. -
setOutputMode
-
setOutputMode
-
isIncludeFullMetadata
Deprecated.since 4.1, removal planned for 5.0; seewritesMetadata() -
setIncludeFullMetadata
Deprecated.since 4.1, removal planned for 5.0; usesetIncludeMetadata(Boolean) -
toString
-
equals
-
hashCode
public int hashCode()
-
writesMetadata()