Class ZFileOptions


  • public class ZFileOptions
    extends java.lang.Object
    Options to create a ZFile.
    • Constructor Detail

      • ZFileOptions

        public ZFileOptions()
        Creates a new options object. All options are set to their defaults.
    • Method Detail

      • getStorageFactory

        public ByteStorageFactory getStorageFactory()
        Obtains the ZFile's byte storage factory.
        Returns:
        the factory used to create byte storages used to store data
      • getTracker

        @Deprecated
        public ByteTracker getTracker()
        Deprecated.
      • setStorageFactory

        public ZFileOptions setStorageFactory​(ByteStorageFactory storage)
        Sets the byte storage factory to use.
        Parameters:
        storage - the factory to use to create storage for new instances of ZFile created for these options.
      • getCompressor

        public Compressor getCompressor()
        Obtains the compressor to use.
        Returns:
        the compressor
      • setCompressor

        public ZFileOptions setCompressor​(Compressor compressor)
        Sets the compressor to use.
        Parameters:
        compressor - the compressor
      • getNoTimestamps

        public boolean getNoTimestamps()
        Obtains whether timestamps should be zeroed.
        Returns:
        should timestamps be zeroed?
      • setNoTimestamps

        public ZFileOptions setNoTimestamps​(boolean noTimestamps)
        Sets whether timestamps should be zeroed.
        Parameters:
        noTimestamps - should timestamps be zeroed?
      • getAlignmentRule

        public AlignmentRule getAlignmentRule()
        Obtains the alignment rule.
        Returns:
        the alignment rule
      • setAlignmentRule

        public ZFileOptions setAlignmentRule​(AlignmentRule alignmentRule)
        Sets the alignment rule.
        Parameters:
        alignmentRule - the alignment rule
      • getCoverEmptySpaceUsingExtraField

        public boolean getCoverEmptySpaceUsingExtraField()
        Obtains whether the extra field should be used to cover empty spaces. See ZFile for an explanation on using the extra field for covering empty spaces.
        Returns:
        should the extra field be used to cover empty spaces?
      • setCoverEmptySpaceUsingExtraField

        public ZFileOptions setCoverEmptySpaceUsingExtraField​(boolean coverEmptySpaceUsingExtraField)
        Sets whether the extra field should be used to cover empty spaces. See ZFile for an explanation on using the extra field for covering empty spaces.
        Parameters:
        coverEmptySpaceUsingExtraField - should the extra field be used to cover empty spaces?
      • getAutoSortFiles

        public boolean getAutoSortFiles()
        Obtains whether files should be automatically sorted before updating the zip file. See ZFile for an explanation on automatic sorting.
        Returns:
        should the file be automatically sorted?
      • setAutoSortFiles

        public ZFileOptions setAutoSortFiles​(boolean autoSortFiles)
        Sets whether files should be automatically sorted before updating the zip file. See ZFile for an explanation on automatic sorting.
        Parameters:
        autoSortFiles - should the file be automatically sorted?
      • setVerifyLogFactory

        public ZFileOptions setVerifyLogFactory​(com.google.common.base.Supplier<VerifyLog> verifyLogFactory)
        Sets the verification log factory.
        Parameters:
        verifyLogFactory - verification log factory
      • getVerifyLogFactory

        public com.google.common.base.Supplier<VerifyLog> getVerifyLogFactory()
        Obtains the verification log factory. By default, the verification log doesn't store anything and will always return an empty log.
        Returns:
        the verification log factory
      • setSkipValidation

        public ZFileOptions setSkipValidation​(boolean skipValidation)
        Sets whether expensive validation should be skipped during ZFile creation
        Parameters:
        skipValidation - during creation?
      • getSkipValidation

        public boolean getSkipValidation()
        Gets whether expensive validation should be performed during ZFile creation
        Returns:
        skip verification during creation?
      • setAlwaysGenerateJarManifest

        public ZFileOptions setAlwaysGenerateJarManifest​(boolean alwaysGenerateJarManifest)
        Sets whether to always generate the MANIFEST.MF file, regardless whether the APK is signed with v1 signing scheme.
      • getAlwaysGenerateJarManifest

        public boolean getAlwaysGenerateJarManifest()
        Returns whether the MANIFEST.MF file should always be generated.