Detailed reference of prototypes, properties and methods available in the
Javascript environment of your Helma web applications.

Fields and methods of the helma.Zip class.

To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/helma/Zip.js')
helma Zip(file)
Constructs a new helma.Zip instance
parameters
helma.File, java.io.File, String file Either a file object representing the .zip file on disk, or the path to the .zip file as string.
methods
  • add(f, level, pathPrefix)
helma Zip.Content()
Creates a new helma.Zip.Content instance
methods
properties
helma Zip.Entry(entry)
Creates a new instance of helma.Zip.Entry
parameters
java.util.zip.ZipEntry entry The zip entry object whose metadata should be stored in this instance
properties
Array helma.Zip.Content. toc
The table of contents of the archive
The files contained in the zip archive, where each directory level is a separate object containing the entries (files and directories) as properties.
String helma.Zip.Entry. name
The name of the zip archive entry
Number helma.Zip.Entry. size
The size of the entry in bytes
Date helma.Zip.Entry. time
The file date of the entry
Boolean helma.Zip.Entry. isDirectory
True if the entry is a directory, false otherwise
ByteArray helma.Zip.Entry. data
The data of the zip entry
Methods
helma.Zip. list()
Returns an array containing the entries of the archive represented by this helma.Zip instance.
returns
The entries stored in the zip archive
helma.Zip. extract(name, destPath)
Extracts a single file from the zip archive represented by this helma.Zip instance. If a destination path is given it writes the extracted data directly to disk using the name of the zip entry, otherwise the resulting entry object contains the extracted data in the property data.
parameters
String name The name of the file to extract
String destPath An optional destination path where the extracted file should be stored.
returns
An object containing the entry's properties
see
helma.Zip. extractAll(destPath)
Extracts all files within the zip archive represented by this helma.Zip instance. If a destination path is given it stores the files directly on disk, while preserving any directory structure within the archive. If no destination path is given, the resulting entry objects will contain the extracted data in their property data.
parameters
String destPath An optional destination path where the files in the zip archive should be stored.
returns
An object containing the extracted entries.
see
helma.Zip. add(f, level, pathPrefix)
Adds a single file or a whole directory (recursive!) to the zip archive
parameters
helma.File, java.io.File, String 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.
Number level An optional compression level to use. The argument must be between zero and 9 (default: 9 = best compression).
String pathPrefix An optional path prefix to use within the archive.
helma.Zip. addData(buf, name, level)
Adds a new entry to the zip file.
parameters
ByteArray buf A byte array containing the data to add to the archive.
String name The name of the file to add, containing an optional path prefix
Number level The compression level to use (0-9, defaults to 9).
helma.Zip. close()
Closes the zip archive. This method should be called when all operations have been finished, to ensure that no open file handles are left.
helma.Zip. getData()
Returns the binary data of the zip archive.
returns
A ByteArray containing the binary data of the zip archive
helma.Zip. save(dest)
Saves the archive.
parameters
String dest The full destination path including the name where the zip archive should be saved.
helma.Zip.Content. add(entry)
Adds a zip entry object to the table of contents and the files collection
parameters
helma.Zip.Entry entry The entry to add to the zip archive
helma. Zip.extractData(zipData)
Extracts all files in the zip archive data passed as argument and returns them.
parameters
ByteArray zipData A ByteArray containing the data of the zip archive
returns
The entries of the zip archive
Fri, 05 Feb 2010 17:40:05 GMT.

core framework

optional modules

java libraries

properties files