Class ArchiveSaveOptions
- java.lang.Object
-
- com.aspose.zip.ArchiveSaveOptions
-
public class ArchiveSaveOptions extends Object
Options for saving a ZIP archive.
-
-
Constructor Summary
Constructors Constructor Description ArchiveSaveOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetArchiveComment()Gets optional comment for the Zip file.booleangetCloseEntrySource()Gets a value indicating whether entries' sources should be closed right after an entry has been compressed.ZipDataDescriptorPolicygetDataDescriptorPolicy()Gets settings for Data Descriptor emission.CharsetgetEncoding()Gets encoding for converting file names and other strings to bytes.EncryptionSettingsgetEncryptionOptions()Gets encryption settings for saving existing ZIP archive.EventsBaggetEventsBag()Gets container of events raising on archive saving.ParallelOptionsgetParallelOptions()Gets settings for parallel compression.SelfExtractorOptionsgetSelfExtractorOptions()Gets settings for self extracted archive.voidsetArchiveComment(String value)Sets optional comment for the Zip file.voidsetCloseEntrySource(boolean value)Sets a value indicating whether entries' sources should be closed right after an entry has been compressed.voidsetDataDescriptorPolicy(ZipDataDescriptorPolicy value)Sets settings for Data Descriptor emission.voidsetEncoding(Charset value)Sets encoding for converting file names and other strings to bytes.voidsetEncryptionOptions(EncryptionSettings value)Sets encryption settings for saving existing ZIP archive.voidsetEventsBag(EventsBag value)Sets container of events raising on archive saving.voidsetParallelOptions(ParallelOptions value)Sets settings for parallel compression.voidsetSelfExtractorOptions(SelfExtractorOptions value)Sets settings for self extracted archive.
-
-
-
Method Detail
-
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:
- encoding for converting file names and other strings to bytes.
-
setEncoding
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:
value- encoding for converting file names and other strings to bytes.
-
getArchiveComment
public final String getArchiveComment()
Gets optional comment for the Zip file.
- Returns:
- optional comment for the Zip file.
-
setArchiveComment
public final void setArchiveComment(String value)
Sets optional comment for the Zip file.
- Parameters:
value- optional comment for the Zip file.
-
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:
- settings for parallel compression.
-
setParallelOptions
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:
value- 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:
- settings for self extracted archive.
-
setSelfExtractorOptions
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:
value- settings for self extracted archive.
-
getEventsBag
public final EventsBag getEventsBag()
Gets container of events raising on archive saving.
- Returns:
- container of events raising on archive saving.
-
setEventsBag
public final void setEventsBag(EventsBag value)
Sets container of events raising on archive saving.
- Parameters:
value- container of events raising on archive saving.
-
getCloseEntrySource
public final boolean getCloseEntrySource()
Gets a value indicating whether entries' sources should be closed right after an entry has been compressed.
- Returns:
- a value indicating whether entries' sources should be closed right after an entry has been compressed.
-
setCloseEntrySource
public final void setCloseEntrySource(boolean value)
Sets a value indicating whether entries' sources should be closed right after an entry has been compressed.
- Parameters:
value- a value indicating whether entries' sources should be closed right after an entry has been compressed.
-
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, use
new com.aspose.zip.ArchiveEntrySettings(CompressionSettings, EncryptionSettings)(ArchiveEntrySettings(CompressionSettings, EncryptionSettings)) instead.Not compatible with
DataDescriptorPolicy(getDataDescriptorPolicy()/setDataDescriptorPolicy(com.aspose.zip.ZipDataDescriptorPolicy)) having valueZipDataDescriptorPolicy.ForAllFileEntries- Returns:
- encryption settings for saving existing ZIP archive.
-
setEncryptionOptions
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, use
new com.aspose.zip.ArchiveEntrySettings(CompressionSettings, EncryptionSettings)(ArchiveEntrySettings(CompressionSettings, EncryptionSettings)) instead.Not compatible with
DataDescriptorPolicy(getDataDescriptorPolicy()/setDataDescriptorPolicy(com.aspose.zip.ZipDataDescriptorPolicy)) having valueZipDataDescriptorPolicy.ForAllFileEntries- Parameters:
value- of sets encryption settings for saving existing ZIP archive.
-
getDataDescriptorPolicy
public final ZipDataDescriptorPolicy getDataDescriptorPolicy()
Gets settings for Data Descriptor emission.
Default option is always present data descriptor.
ZipDataDescriptorPolicy.ForAllFileEntriesis not compatible with archive encryption.- Returns:
- settings for Data Descriptor emission.
-
setDataDescriptorPolicy
public final void setDataDescriptorPolicy(ZipDataDescriptorPolicy value)
Sets settings for Data Descriptor emission.
Default option is always present data descriptor.
ZipDataDescriptorPolicy.ForAllFileEntriesis not compatible with archive encryption.- Parameters:
value- settings for Data Descriptor emission.
-
-