Class OutArchive7zImpl

java.lang.Object
net.sf.sevenzipjbinding.impl.OutArchiveImpl<IOutItem7z>
net.sf.sevenzipjbinding.impl.OutArchive7zImpl
All Implemented Interfaces:
Closeable, AutoCloseable, 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 Details

    • OutArchive7zImpl

      public OutArchive7zImpl()
  • Method Details

    • setLevel

      public void setLevel(int compressionLevel)
      Description copied from interface: IOutFeatureSetLevel
      Set compression level:
      • 0 - Copy mode (no compression)
      • 1 - Fastest
      • 3 - Fast
      • 5 - Normal
      • 7 - Maximum
      • 9 - Ultra
      Note that the meaning of the compression level can differ across 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 is no guarantee that no further callback methods will be called. The first and last thrown exceptions will be saved and thrown later on from the originally called method such as IInArchive.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:
    • 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:
    • 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:
    • 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