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

- list()

- extract(name, destPath)

- extractAll(destPath)

- add(f, level, pathPrefix)

- addData(buf, name, level)

- close()

- getData()

- save(dest)

helma Zip.Content()
Creates a new helma.Zip.Content instance
methods

- add(entry)

properties

- Array toc

- files

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

- String name

- Number size

- Date time

- Boolean isDirectory

- ByteArray data

Array helma.Zip.Content. toc
The table of contents of the archive
helma.Zip.Content. files
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.Entry

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.Entry

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

Tue, 25 Nov 2008 16:50:11 GMT.

### core framework

- global
- app (application)
- req (request)
- res (response)
- session
- path
- root
- HopObject
- User
- File
- FtpClient
- Image
- Mail
- Remote
- Xml
- DatabaseObject
- MimePart
- Skin
- Object

### optional modules

- Array extensions
- Date extensions
- Number extensions
- Object extensions
- String extensions
- HopObject extensions
- global macros
- macro filters
- JSON methods
- helma.Aspects
- helma.Chart
- helma.Color
- helma.Database
- helma.File
- helma.Ftp
- helma.Group
- helma.Html
- helma.Http
- helma.Image
- helma.Mail
- helma.Search
- helma.Skin
- helma.Ssh
- helma.Url
- helma.Zip
- jala.BitTorrent
- jala.Captcha
- jala.Date
- jala.db
- jala.DnsClient
- jala.Form
- jala.History
- jala HopObject extensions
- jala.HtmlDocument
- jala.I18n
- jala.ImageFilter
- jala.IndexManager
- jala.ListRenderer
- jala.Mp3
- jala.PodcastWriter
- jala.RemoteContent
- jala.Rss20Writer
- jala.Utilities
- jala.XmlRpcRequest
- jala.XmlWriter

### java libraries

- browse docjar