Top Description Inners Fields Constructors Methods
org.apache.commons.compress.archivers.sevenz

public Class SevenZFileOptions

extends Object
Class Inheritance
Annotations
@Deprecated

Deprecated

Use SevenZFile.Builder.

Collects options for reading 7z archives.
Since
1.19

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
SevenZFileOptions.Builder

Mutable builder for the immutable SevenZFileOptions.

Field Summary

Modifier and TypeField and Description
public static final SevenZFileOptions
DEFAULT

The default options.

private final int
private final boolean
private final boolean

Constructor Summary

AccessConstructor and Description
private
SevenZFileOptions(final int maxMemoryLimitKb, final boolean useDefaultNameForUnnamedEntries, final boolean tryToRecoverBrokenArchives)

Method Summary

Modifier and TypeMethod and Description
public static SevenZFileOptions.Builder

Returns:

a builder for SevenZFileOptions.
builder
()

Obtains a builder for SevenZFileOptions.

public int

Returns:

the maximum amount of memory to use for extraction
getMaxMemoryLimitInKb
()

Gets the maximum amount of memory to use for parsing the archive and during extraction.

public boolean

Returns:

whether SevenZFile shall try to recover from a certain type of broken archive.
getTryToRecoverBrokenArchives
()

Whether SevenZFile shall try to recover from a certain type of broken archive.

public boolean

Returns:

whether entries without a name should get their names set to the archive's default file name
getUseDefaultNameForUnnamedEntries
()

Gets whether entries without a name should get their names set to the archive's default file name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
public static final SevenZFileOptions DEFAULT

Deprecated

as a consequence of SevenZFileOptions being deprecated. See corresponding docs for further information.

The default options.

  • no memory limit
  • don't modify the name of unnamed entries
maxMemoryLimitKbback to summary
private final int maxMemoryLimitKb
tryToRecoverBrokenArchivesback to summary
private final boolean tryToRecoverBrokenArchives
useDefaultNameForUnnamedEntriesback to summary
private final boolean useDefaultNameForUnnamedEntries

Constructor Detail

SevenZFileOptionsback to summary
private SevenZFileOptions(final int maxMemoryLimitKb, final boolean useDefaultNameForUnnamedEntries, final boolean tryToRecoverBrokenArchives)

Method Detail

builderback to summary
public static SevenZFileOptions.Builder builder()

Obtains a builder for SevenZFileOptions.

Returns:SevenZFileOptions.Builder

a builder for SevenZFileOptions.

getMaxMemoryLimitInKbback to summary
public int getMaxMemoryLimitInKb()

Gets 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.

Returns:int

the maximum amount of memory to use for extraction

getTryToRecoverBrokenArchivesback to summary
public boolean getTryToRecoverBrokenArchives()

Whether SevenZFile shall try to recover from a certain type of broken archive.

Returns:boolean

whether SevenZFile shall try to recover from a certain type of broken archive.

Since
1.21
getUseDefaultNameForUnnamedEntriesback to summary
public boolean getUseDefaultNameForUnnamedEntries()

Gets whether entries without a name should get their names set to the archive's default file name.

Returns:boolean

whether entries without a name should get their names set to the archive's default file name

org.apache.commons.compress.archivers.sevenz back to summary

public Class SevenZFileOptions.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • org.apache.commons.compress.archivers.sevenz.SevenZFileOptions.Builder

Mutable builder for the immutable SevenZFileOptions.
Since
1.19

Field Summary

Modifier and TypeField and Description
private int
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SevenZFileOptions

Returns:

configured SevenZFileOptions.
build
()

Deprecated as a consequence of SevenZFileOptions being deprecated.
Builds the SevenZFileOptions.
public SevenZFileOptions.Builder

Returns:

the reconfigured builder
withMaxMemoryLimitInKb
(final int
limit of the maximum amount of memory to use
maxMemoryLimitInKb
)

Sets the maximum amount of memory to use for parsing the archive and during extraction.

public SevenZFileOptions.Builder

Returns:

the reconfigured builder
withTryToRecoverBrokenArchives
(final boolean
if true SevenZFile will try to recover archives that are broken in the specific way
tryToRecoverBrokenArchives
)

Sets whether SevenZFile will try to recover broken archives where the CRC of the file's metadata is 0.

public SevenZFileOptions.Builder

Returns:

the reconfigured builder
withUseDefaultNameForUnnamedEntries
(final boolean
if true the name of unnamed entries will be set to the archive's default name
useDefaultNameForUnnamedEntries
)

Sets whether entries without a name should get their names set to the archive's default file name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxMemoryLimitKbback to summary
private int maxMemoryLimitKb
tryToRecoverBrokenArchivesback to summary
private boolean tryToRecoverBrokenArchives
useDefaultNameForUnnamedEntriesback to summary
private boolean useDefaultNameForUnnamedEntries

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public SevenZFileOptions build()

Deprecated

as a consequence of SevenZFileOptions being deprecated. See corresponding docs for further information.

Builds the SevenZFileOptions.

Returns:SevenZFileOptions

configured SevenZFileOptions.

withMaxMemoryLimitInKbback to summary
public SevenZFileOptions.Builder withMaxMemoryLimitInKb(final int maxMemoryLimitInKb)

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
maxMemoryLimitInKb:int

limit of the maximum amount of memory to use

Returns:SevenZFileOptions.Builder

the reconfigured builder

withTryToRecoverBrokenArchivesback to summary
public SevenZFileOptions.Builder withTryToRecoverBrokenArchives(final boolean tryToRecoverBrokenArchives)

Sets whether SevenZFile 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 at the same time.

Parameters
tryToRecoverBrokenArchives:boolean

if true SevenZFile will try to recover archives that are broken in the specific way

Returns:SevenZFileOptions.Builder

the reconfigured builder

Since
1.21
withUseDefaultNameForUnnamedEntriesback to summary
public SevenZFileOptions.Builder withUseDefaultNameForUnnamedEntries(final boolean useDefaultNameForUnnamedEntries)

Sets whether entries without a name should get their names set to the archive's default file name.

Parameters
useDefaultNameForUnnamedEntries:boolean

if true the name of unnamed entries will be set to the archive's default name

Returns:SevenZFileOptions.Builder

the reconfigured builder