ANEZipFile Adobe AIR iOS Native Extension to zip/unzip files. Features:Unzip- Unzip Files Asynchronously
- Unzip password protected files
- Unzip single file from zip to ByteArray ( Sync/Async )
- List Files inside zip
- Determine if zip is password protected
Zip- Zip contents of a directory from FileSystem Asynchronously
- Zip group of Files from Filesystem Asynchronously
- Append files from FileSystem to zip ( Sync/Async )
- Append ByteArray Data to a file inside zip ( Sync/Async )
Todo- Add working example
- Enable creation of password protected zips
Actionscript ClassesANEZipUtils Methods- listDirToZip(folder : File) : Array;
复制代码 List Directory contents of folder.Returns an array of file paths.- extractFile(zipfile : File, fileName : String, password : String = "") : ByteArray;
复制代码 Synchronously gets the contents of a single file in zip.Return ByteArray data of the extracted file.Pass a password if the zip file is password protected- extractFileAsync(zipfile : File, fileName : String, password : String = "") : void;
复制代码
ASynchronously gets the contents of a single file in zip.Pass a password if the zip file is password protected.Dispatches ANEZipFileEvent.UNZIP_FILE_BYTES. event.resultBytes -> will contain the file ByteArray representation.- getZipContents(zipfile : File) : Array;
复制代码 Get a list of the files inside the zip- isPasswordProtected(zipfile : File) : Boolean;
复制代码 Determines if the provided zip file is password protected- unzip(zipfile : File, destination : File, overwrite : Boolean = false, password : String = "") : void;
复制代码 Unzips a zip file to the filesystem.
Dispatches ANEZipFileEvent.UNZIP_START when the process is started.Dispatches ANEZipFileEvent.UNZIP_END when the process is finished.
event.eventData will contain:
* source -> path of original zip file
* destination -> path of the destination dirDispatches ANEZipFileEvent.UNZIP_PROGRESS while processing.
event.eventData will contain:
* current -> current index of decompressed file
* total -> total files to decompress inside zip
* path -> current decompressed file path- zipDirectory(outputZip : File, sourceDirectory : File) : void;
复制代码 Zips the contents of a directoryDispatches ANEZipFileEvent.
ZIP_START when the process is started.
event.eventData will contain:
* path -> Path to the generated zip fileDispatches ANEZipFileEvent.ZIP_END when the process is finished.
event.eventData will contain:
* path -> Path to the generated zip file
* success -> Success of the zip actionDispatches ANEZipFileEvent.ZIP_PROGRESS while processing.
event.eventData will contain:
* current -> current index of compressed file
* total -> total files to compress inside zip- zipFiles(outputZip : File, sourceFiles : Array, destinationFiles : Array = null) : void;
复制代码 Zips files to a zip.Dispatches ANEZipFileEvent.ZIP_START when the process is started.
event.eventData will contain:
* path -> Path to the generated zip fileDispatches ANEZipFileEvent.ZIP_END when the process is finished.
event.eventData will contain:
* path -> Path to the generated zip file
* success -> Success of the zip actionDispatches ANEZipFileEvent.ZIP_PROGRESS while processing.
event.eventData will contain:
* current -> current index of compressed file
* total -> total files to compress inside zip
ANEZipFile Methods
- addFile(file : File, destination : String = "") : Boolean;
复制代码 Add a file to the zip- addFileAsync(file : File, destination : String = "") : void;
复制代码 Add a file to the zip ASynchronouslyCloses de current zip fileDisposes instance- open(zipfile : File, fileMode : uint = 0) : Boolean;
复制代码 Open a zip file for create / append files.Avaliable filemodes are:
* ANEZipFile.FILE_MODE_CREATE
* ANEZipFile.FILE_MODE_APPEND- writeBytes(bytes : ByteArray, fileName : String) : Boolean;
复制代码 Write ByteArray data to a file in zip- writeBytesAsync(bytes : ByteArray, fileName : String) : void;
复制代码 Write ByteArray data to a file in zip ASynchronously
License ANEZipFile by Pedro Casaubon is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
A slightly modified version of SSZipArchive that is licensed under the MIT license ThanksThanks soffes for creating SSZipArchive which ANEZipFile is based on
相关链接:
https://github.com/xperiments/ANEZipFile
|