ArchiveSaveOptions
Inheritance: java.lang.Object
public class ArchiveSaveOptions
Options for saving a zip archive.
Constructors
Constructor | Description |
---|---|
ArchiveSaveOptions() |
Methods
Method | Description |
---|---|
getArchiveComment() | Gets optional comment for the Zip file. |
getCloseEntrySource() | Gets a value indicating whether entries’ sources should be closed right after an entry has been compressed. |
getEncoding() | Gets encoding for converting file names and other strings to bytes. |
getEncryptionOptions() | Gets encryption settings for saving existing zip archive. |
getEventsBag() | Gets container of events raising on archive saving. |
getParallelOptions() | Gets settings for parallel compression. |
getSelfExtractorOptions() | Gets settings for self extracted archive. |
setArchiveComment(String value) | Sets optional comment for the Zip file. |
setCloseEntrySource(boolean value) | Sets a value indicating whether entries’ sources should be closed right after an entry has been compressed. |
setEncoding(Charset value) | Sets encoding for converting file names and other strings to bytes. |
setEncryptionOptions(EncryptionSettings value) | Sets encryption settings for saving existing zip archive. |
setEventsBag(EventsBag value) | Sets container of events raising on archive saving. |
setParallelOptions(ParallelOptions value) | Sets settings for parallel compression. |
setSelfExtractorOptions(SelfExtractorOptions value) | Sets settings for self extracted archive. |
ArchiveSaveOptions()
public ArchiveSaveOptions()
getArchiveComment()
public final String getArchiveComment()
Gets optional comment for the Zip file.
Returns: java.lang.String - optional comment for the Zip file.
getCloseEntrySource()
public final boolean getCloseEntrySource()
Gets a value indicating whether entries’ sources should be closed right after an entry has been compressed.
Returns: boolean - a value indicating whether entries’ sources should be closed right after an entry has been compressed
getEncoding()
public final Charset getEncoding()
Gets encoding for converting file names and other strings to bytes.
If not set, code page 437 will be used.
Returns: java.nio.charset.Charset - encoding for converting file names and other strings to bytes.
getEncryptionOptions()
public final EncryptionSettings getEncryptionOptions()
Gets encryption settings for saving existing zip archive.
try (Archive archive = new Archive("plain.zip")) {
ArchiveSaveOptions options = new ArchiveSaveOptions();
options.setEncryptionOptions(new AesEncryptionSettings("p@s$", EncryptionMethod.AES256));
archive.save("encripted.zip", options);
}
Do not use this options for regular composition of encrypted archive.
Returns: EncryptionSettings - encryption settings for saving existing zip archive.
getEventsBag()
public final EventsBag getEventsBag()
Gets container of events raising on archive saving.
Returns: EventsBag - container of events raising on archive saving.
getParallelOptions()
public final ParallelOptions getParallelOptions()
Gets settings for parallel compression.
Assign it if you want to utilize several CPU cores while compressing several archive entries.
Returns: ParallelOptions - settings for parallel compression.
getSelfExtractorOptions()
public final SelfExtractorOptions getSelfExtractorOptions()
Gets settings for self extracted archive.
Assign it if you need to compose executable program to extract an archive without any software installed on the target computer.
Returns: SelfExtractorOptions - settings for self extracted archive.
setArchiveComment(String value)
public final void setArchiveComment(String value)
Sets optional comment for the Zip file.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | optional comment for the Zip file. |
setCloseEntrySource(boolean value)
public final void setCloseEntrySource(boolean value)
Sets a value indicating whether entries’ sources should be closed right after an entry has been compressed.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | a value indicating whether entries’ sources should be closed right after an entry has been compressed |
setEncoding(Charset value)
public final void setEncoding(Charset value)
Sets encoding for converting file names and other strings to bytes.
If not set, code page 437 will be used.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.nio.charset.Charset | encoding for converting file names and other strings to bytes. |
setEncryptionOptions(EncryptionSettings value)
public final void setEncryptionOptions(EncryptionSettings value)
Sets encryption settings for saving existing zip archive.
try (Archive archive = new Archive("plain.zip")) {
ArchiveSaveOptions options = new ArchiveSaveOptions();
options.setEncryptionOptions(new AesEncryptionSettings("p@s$", EncryptionMethod.AES256));
archive.save("encripted.zip", options);
}
Do not use this options for regular composition of encrypted archive.
Parameters:
Parameter | Type | Description |
---|---|---|
value | EncryptionSettings | encryption settings for saving existing zip archive. |
setEventsBag(EventsBag value)
public final void setEventsBag(EventsBag value)
Sets container of events raising on archive saving.
Parameters:
Parameter | Type | Description |
---|---|---|
value | EventsBag | container of events raising on archive saving. |
setParallelOptions(ParallelOptions value)
public final void setParallelOptions(ParallelOptions value)
Sets settings for parallel compression.
Assign it if you want to utilize several CPU cores while compressing several archive entries.
Parameters:
Parameter | Type | Description |
---|---|---|
value | ParallelOptions | settings for parallel compression. |
setSelfExtractorOptions(SelfExtractorOptions value)
public final void setSelfExtractorOptions(SelfExtractorOptions value)
Sets settings for self extracted archive.
Assign it if you need to compose executable program to extract an archive without any software installed on the target computer.
Parameters:
Parameter | Type | Description |
---|---|---|
value | SelfExtractorOptions | settings for self extracted archive. |