Class ZFiles


  • public class ZFiles
    extends java.lang.Object
    Factory for ZFiles that are specifically configured to be APKs, AARs, ...
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static ZFile apk​(java.io.File f, ZFileOptions options)
      Creates a new zip file configured as an apk, based on a given file.
      static ZFile apk​(java.io.File f, ZFileOptions options, com.google.common.base.Optional<SigningOptions> signingOptions, java.lang.String builtBy, java.lang.String createdBy)
      Creates a new zip file configured as an apk, based on a given file.
      static ZFile apk​(java.io.File f, ZFileOptions options, com.google.common.base.Optional<SigningOptions> signingOptions, java.lang.String builtBy, java.lang.String createdBy, boolean writeManifest)
      Deprecated.
      Use ZFileOptions.setAlwaysGenerateJarManifest() instead.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • apk

        public static ZFile apk​(java.io.File f,
                                ZFileOptions options)
                         throws java.io.IOException
        Creates a new zip file configured as an apk, based on a given file.
        Parameters:
        f - the file, if this path does not represent an existing path, will create a ZFile based on an non-existing path (a zip will be created when ZFile.close() is invoked)
        options - the options to create the ZFile
        Returns:
        the zip file
        Throws:
        java.io.IOException - failed to create the zip file
      • apk

        public static ZFile apk​(java.io.File f,
                                ZFileOptions options,
                                com.google.common.base.Optional<SigningOptions> signingOptions,
                                @Nullable
                                java.lang.String builtBy,
                                @Nullable
                                java.lang.String createdBy)
                         throws java.io.IOException
        Creates a new zip file configured as an apk, based on a given file.
        Parameters:
        f - the file, if this path does not represent an existing path, will create a ZFile based on an non-existing path (a zip will be created when ZFile.close() is invoked)
        options - the options to create the ZFile
        signingOptions - the options to sign the apk
        builtBy - who to mark as builder in the manifest
        createdBy - who to mark as creator in the manifest
        Returns:
        the zip file
        Throws:
        java.io.IOException - failed to create the zip file
      • apk

        @Deprecated
        public static ZFile apk​(java.io.File f,
                                ZFileOptions options,
                                com.google.common.base.Optional<SigningOptions> signingOptions,
                                @Nullable
                                java.lang.String builtBy,
                                @Nullable
                                java.lang.String createdBy,
                                boolean writeManifest)
                         throws java.io.IOException
        Deprecated.
        Use ZFileOptions.setAlwaysGenerateJarManifest() instead.
        Creates a new zip file configured as an apk, based on a given file.
        Parameters:
        f - the file, if this path does not represent an existing path, will create a ZFile based on an non-existing path (a zip will be created when ZFile.close() is invoked)
        options - the options to create the ZFile
        signingOptions - the options to sign the apk
        builtBy - who to mark as builder in the manifest
        createdBy - who to mark as creator in the manifest
        writeManifest - a migration parameter that forces keeping (useless) manifest.mf file in apk file in order to prevent breaking changes. Clients of the previous interface will still get apk with manifest.mf because the flag is true by default
        Returns:
        the zip file
        Throws:
        java.io.IOException - failed to create the zip file