Class ZFileOptions
- java.lang.Object
-
- com.android.tools.build.apkzlib.zip.ZFileOptions
-
public class ZFileOptions extends java.lang.ObjectOptions to create aZFile.
-
-
Constructor Summary
Constructors Constructor Description ZFileOptions()Creates a new options object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AlignmentRulegetAlignmentRule()Obtains the alignment rule.booleangetAlwaysGenerateJarManifest()Returns whether the MANIFEST.MF file should always be generated.booleangetAutoSortFiles()Obtains whether files should be automatically sorted before updating the zip file.CompressorgetCompressor()Obtains the compressor to use.booleangetCoverEmptySpaceUsingExtraField()Obtains whether the extra field should be used to cover empty spaces.booleangetNoTimestamps()Obtains whether timestamps should be zeroed.booleangetSkipValidation()Gets whether expensive validation should be performed duringZFilecreationByteStorageFactorygetStorageFactory()Obtains the ZFile's byte storage factory.ByteTrackergetTracker()Deprecated.com.google.common.base.Supplier<VerifyLog>getVerifyLogFactory()Obtains the verification log factory.ZFileOptionssetAlignmentRule(AlignmentRule alignmentRule)Sets the alignment rule.ZFileOptionssetAlwaysGenerateJarManifest(boolean alwaysGenerateJarManifest)Sets whether to always generate the MANIFEST.MF file, regardless whether the APK is signed with v1 signing scheme.ZFileOptionssetAutoSortFiles(boolean autoSortFiles)Sets whether files should be automatically sorted before updating the zip file.ZFileOptionssetCompressor(Compressor compressor)Sets the compressor to use.ZFileOptionssetCoverEmptySpaceUsingExtraField(boolean coverEmptySpaceUsingExtraField)Sets whether the extra field should be used to cover empty spaces.ZFileOptionssetNoTimestamps(boolean noTimestamps)Sets whether timestamps should be zeroed.ZFileOptionssetSkipValidation(boolean skipValidation)Sets whether expensive validation should be skipped duringZFilecreationZFileOptionssetStorageFactory(ByteStorageFactory storage)Sets the byte storage factory to use.ZFileOptionssetVerifyLogFactory(com.google.common.base.Supplier<VerifyLog> verifyLogFactory)Sets the verification log factory.
-
-
-
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 ofZFilecreated 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. SeeZFilefor 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. SeeZFilefor 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. SeeZFilefor 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. SeeZFilefor 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 duringZFilecreation- Parameters:
skipValidation- during creation?
-
getSkipValidation
public boolean getSkipValidation()
Gets whether expensive validation should be performed duringZFilecreation- 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.
-
-