net.sf.sevenzipjbinding.impl
Class OutArchive7zImpl

java.lang.Object
  extended by net.sf.sevenzipjbinding.impl.OutArchiveImpl<IOutItem7z>
      extended by net.sf.sevenzipjbinding.impl.OutArchive7zImpl
All Implemented Interfaces:
java.io.Closeable, IOutArchive<IOutItem7z>, IOutArchiveBase, IOutCreateArchive<IOutItem7z>, IOutCreateArchive7z, IOutFeatureSetEncryptHeader, IOutFeatureSetLevel, IOutFeatureSetMultithreading, IOutFeatureSetSolid, IOutUpdateArchive<IOutItem7z>, IOutUpdateArchive7z

public class OutArchive7zImpl
extends OutArchiveImpl<IOutItem7z>
implements IOutCreateArchive7z, IOutUpdateArchive7z

7z specific archive create and update class.

Since:
9.20-2.00
Author:
Boris Brodski

Constructor Summary
OutArchive7zImpl()
           
 
Method Summary
 void setHeaderEncryption(boolean enabled)
          Enable/disable header encryption for password protected archives.
 void setLevel(int compressionLevel)
          Set compression level: 0 - Copy mode (no compression) 1 - Fastest 3 - Fast 5 - Normal 7 - Maximum 9 - Ultra Note, that the meaning of compression level can differ through out different archive formats.
 void setSolid(boolean solid)
          Set solid archive option.
 void setSolidExtension(boolean solidExtension)
          Put all files with the same extension following each other in the order of packing in a solid block.
 void setSolidFiles(int countOfFilesPerBlock)
          Put specified count of files in a single solid block.
 void setSolidSize(long countOfBytesPerBlock)
          Put specified count of bytes in a single solid block.
 void setThreadCount(int threadCount)
          Set number of threads to use.
 
Methods inherited from class net.sf.sevenzipjbinding.impl.OutArchiveImpl
close, createArchive, getArchiveFormat, getConnectedInArchive, getTracePrintStream, isTrace, setTrace, setTracePrintStream, updateItems
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.sevenzipjbinding.IOutCreateArchive
createArchive, getArchiveFormat
 
Methods inherited from interface net.sf.sevenzipjbinding.IOutArchiveBase
getTracePrintStream, isTrace, setTrace, setTracePrintStream
 
Methods inherited from interface java.io.Closeable
close
 
Methods inherited from interface net.sf.sevenzipjbinding.IOutUpdateArchive
getArchiveFormat, getConnectedInArchive, updateItems
 
Methods inherited from interface net.sf.sevenzipjbinding.IOutArchiveBase
getTracePrintStream, isTrace, setTrace, setTracePrintStream
 

Constructor Detail

OutArchive7zImpl

public OutArchive7zImpl()
Method Detail

setLevel

public void setLevel(int compressionLevel)
Description copied from interface: IOutFeatureSetLevel
Set compression level: Note, that the meaning of compression level can differ through out different archive formats.

Specified by:
setLevel in interface IOutFeatureSetLevel
Parameters:
compressionLevel - compression level to set. -1 - use default

setHeaderEncryption

public void setHeaderEncryption(boolean enabled)
                         throws SevenZipException
Description copied from interface: IOutFeatureSetEncryptHeader
Enable/disable header encryption for password protected archives. If enabled, the archive header containing file names and other metadata will be encrypted as well.

Note: Implement ICryptoGetTextPassword in your callback class to turn on the encryption.

Specified by:
setHeaderEncryption in interface IOutFeatureSetEncryptHeader
Parameters:
enabled - true enable header encryption, otherwise false
Throws:
SevenZipException - in error case. If this method ends with an exception, the current operation will be reported to 7-Zip as failed. There are no guarantee, that there are no further call back methods will get called. The first and last thrown exceptions will be saved and thrown later on from the originally called method such as ISevenZipInArchive.extract() or SevenZip.openInArchive(). Up to four exceptions depending on the situation can be saved for further analysis. See SevenZipException and SevenZipException.printStackTraceExtended() for details.

setSolid

public void setSolid(boolean solid)
Set solid archive option. If deactivated, some other solid options like 'solid files' will take no effect.

Specified by:
setSolid in interface IOutFeatureSetSolid
Parameters:
solid - true - use default configuration, false - deactivate solid block mode

setSolidFiles

public void setSolidFiles(int countOfFilesPerBlock)
Put specified count of files in a single solid block. See IOutFeatureSetSolid.setSolid(boolean).

Specified by:
setSolidFiles in interface IOutFeatureSetSolid
Parameters:
countOfFilesPerBlock - count of files per solid block. -1 - use default configuration
See Also:
IOutFeatureSetSolid.setSolid(boolean)

setSolidSize

public void setSolidSize(long countOfBytesPerBlock)
Put specified count of bytes in a single solid block. See IOutFeatureSetSolid.setSolid(boolean).

Specified by:
setSolidSize in interface IOutFeatureSetSolid
Parameters:
countOfBytesPerBlock - count of bytes per solid block. -1 - use default configuration.
See Also:
IOutFeatureSetSolid.setSolid(boolean)

setSolidExtension

public void setSolidExtension(boolean solidExtension)
Put all files with the same extension following each other in the order of packing in a solid block. See IOutFeatureSetSolid.setSolid(boolean).

Specified by:
setSolidExtension in interface IOutFeatureSetSolid
Parameters:
solidExtension - true - activate this feature, false - use default configuration
See Also:
IOutFeatureSetSolid.setSolid(boolean)

setThreadCount

public void setThreadCount(int threadCount)
Set number of threads to use.

Specified by:
setThreadCount in interface IOutFeatureSetMultithreading
Parameters:
threadCount - number of threads to use,
0 - match count of threads to the count of the available processors,
-1 - use default value