Object | +--helma.Zip
Instances of this class represent a single zip archive
and provide various methods for extracting entries or manipulating
the contents of the archive.
Defined in Zip.js
Author: Robert Gaggl
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |
| Constructor Summary | |
helma.Zip(<helma.File|java.io.File|String> file)
Constructs a new helma.Zip instance |
|
| Methods Summary | |
void
|
add(<helma.File|java.io.File|String> f, <Number> level, <String> pathPrefix)
Adds a single file or a whole directory (recursive!) to the zip archive |
void
|
addData(<ByteArray> buf, <String> name, <Number> level)
Adds a new entry to the zip file. |
void
|
close()
Closes the zip archive. |
helma.Zip.Entry
|
extract(<String> name, <String> destPath)
Extracts a single file from the zip archive represented by this helma.Zip instance. |
helma.Zip.Content
|
extractAll(<String> destPath)
Extracts all files within the zip archive represented by this helma.Zip instance. |
ByteArray
|
getData()
Returns the binary data of the zip archive. |
helma.Zip.Content
|
list()
Returns an array containing the entries of the archive represented by this helma.Zip instance. |
void
|
save(<String> dest)
Saves the archive. |
<static> helma.Zip.Content
|
extractData(<ByteArray> zipData)
Extracts all files in the zip archive data passed as argument and returns them. |
| Constructor Detail |
helma.Zip(<helma.File|java.io.File|String> file)
file - Either a file object representing the .zip file on disk, or the path to the .zip file as string.
| Method Detail |
void add(<helma.File|java.io.File|String> f, <Number> level, <String> pathPrefix)
f - Either a file object or the path to a file or directory on disk that should be added to the archive. If the argument represents a directory, its contents will be added recursively to the archive.
level - An optional compression level to use. The argument must be between zero and 9 (default: 9 = best compression).
pathPrefix - An optional path prefix to use within the archive.
void addData(<ByteArray> buf, <String> name, <Number> level)
buf - A byte array containing the data to add to the archive.
name - The name of the file to add, containing an optional path prefix
level - The compression level to use (0-9, defaults to 9).
void close()
helma.Zip.Entry extract(<String> name, <String> destPath)
data.name - The name of the file to extract
destPath - An optional destination path where the extracted file should be stored.
helma.Zip.Content extractAll(<String> destPath)
data.destPath - An optional destination path where the files in the zip archive should be stored.
ByteArray getData()
helma.Zip.Content list()
void save(<String> dest)
dest - The full destination path including the name where the zip archive should be saved.
<static> helma.Zip.Content extractData(<ByteArray> zipData)
zipData - A ByteArray containing the data of the zip archive
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |