Class SevenZFileOptions.Builder
java.lang.Object
org.apache.commons.compress.archivers.sevenz.SevenZFileOptions.Builder
- Enclosing class:
- SevenZFileOptions
Mutable builder for the immutable
SevenZFileOptions
.- Since:
- 1.19
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theSevenZFileOptions
.withMaxMemoryLimitInKb
(int maxMemoryLimitKb) Sets the maximum amount of memory to use for parsing the archive and during extraction.withTryToRecoverBrokenArchives
(boolean tryToRecoverBrokenArchives) Sets whetherSevenZFile
will try to recover broken archives where the CRC of the file's metadata is 0.withUseDefaultNameForUnnamedEntries
(boolean useDefaultNameForUnnamedEntries) Sets whether entries without a name should get their names set to the archive's default file name.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Builds theSevenZFileOptions
.- Returns:
- configured
SevenZFileOptions
.
-
withMaxMemoryLimitInKb
Sets the maximum amount of memory to use for parsing the archive and during extraction.Not all codecs will honor this setting. Currently only LZMA and LZMA2 are supported.
- Parameters:
maxMemoryLimitKb
- limit of the maximum amount of memory to use- Returns:
- the reconfigured builder
-
withTryToRecoverBrokenArchives
Sets whetherSevenZFile
will try to recover broken archives where the CRC of the file's metadata is 0.This special kind of broken archive is encountered when mutli volume archives are closed prematurely. If you enable this option SevenZFile will trust data that looks as if it could contain metadata of an archive and allocate big amounts of memory. It is strongly recommended to not enable this option without setting
withMaxMemoryLimitInKb(int)
at the same time.- Parameters:
tryToRecoverBrokenArchives
- if true SevenZFile will try to recover archives that are broken in the specific way- Returns:
- the reconfigured builder
- Since:
- 1.21
-
withUseDefaultNameForUnnamedEntries
public SevenZFileOptions.Builder withUseDefaultNameForUnnamedEntries(boolean useDefaultNameForUnnamedEntries) Sets whether entries without a name should get their names set to the archive's default file name.- Parameters:
useDefaultNameForUnnamedEntries
- if true the name of unnamed entries will be set to the archive's default name- Returns:
- the reconfigured builder
-