Interface ApkCreator
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
public interface ApkCreator extends java.io.CloseableCreates or updates APKs based on provided entries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteFile(java.lang.String apkPath)Deletes a file in a given path.booleanhasPendingChangesWithWait()Returns true if the APK will be rewritten on close.voidwriteFile(java.io.File inputFile, java.lang.String apkPath)Writes a newFileinto the archive.voidwriteZip(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.
-
-
-
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.IOExceptionCopies 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 fromtransform- an optional transform to apply to file names before copying themisIgnored- an optional filter ornullto mark which out files should not be added, even through they are on the zip; iftransformis 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.IOExceptionWrites a newFileinto the archive. If a file already existed with the given path, it should be replaced.- Parameters:
inputFile- theFileto write.apkPath- the filepath inside the archive.- Throws:
java.io.IOException- I/O error
-
deleteFile
void deleteFile(java.lang.String apkPath) throws java.io.IOExceptionDeletes 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.IOExceptionReturns true if the APK will be rewritten on close.- Throws:
java.io.IOException
-
-