Interface ApkCreator

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable

    public interface ApkCreator
    extends java.io.Closeable
    Creates or updates APKs based on provided entries.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deleteFile​(java.lang.String apkPath)
      Deletes a file in a given path.
      boolean hasPendingChangesWithWait()
      Returns true if the APK will be rewritten on close.
      void writeFile​(java.io.File inputFile, java.lang.String apkPath)
      Writes a new File into the archive.
      void writeZip​(java.io.File zip, com.google.common.base.Function<java.lang.String,​java.lang.String> transform, com.google.common.base.Predicate<java.lang.String> isIgnored)
      Copies the content of a Jar/Zip archive into the receiver archive.
      • Methods inherited from interface java.io.Closeable

        close
    • Method Detail

      • writeZip

        void writeZip​(java.io.File zip,
                      @Nullable
                      com.google.common.base.Function<java.lang.String,​java.lang.String> transform,
                      @Nullable
                      com.google.common.base.Predicate<java.lang.String> isIgnored)
               throws java.io.IOException
        Copies the content of a Jar/Zip archive into the receiver archive.

        An optional predicate allows to selectively choose which files to copy over and an option function allows renaming the files as they are copied.

        Parameters:
        zip - the zip to copy data from
        transform - an optional transform to apply to file names before copying them
        isIgnored - an optional filter or null to mark which out files should not be added, even through they are on the zip; if transform is specified, then this predicate applies after transformation
        Throws:
        java.io.IOException - I/O error
      • writeFile

        void writeFile​(java.io.File inputFile,
                       java.lang.String apkPath)
                throws java.io.IOException
        Writes a new File into the archive. If a file already existed with the given path, it should be replaced.
        Parameters:
        inputFile - the File to write.
        apkPath - the filepath inside the archive.
        Throws:
        java.io.IOException - I/O error
      • deleteFile

        void deleteFile​(java.lang.String apkPath)
                 throws java.io.IOException
        Deletes a file in a given path.
        Parameters:
        apkPath - the path to remove
        Throws:
        java.io.IOException - failed to remove the entry
      • hasPendingChangesWithWait

        boolean hasPendingChangesWithWait()
                                   throws java.io.IOException
        Returns true if the APK will be rewritten on close.
        Throws:
        java.io.IOException