Mobile Web Wearable Web

Archive

Tizen enables you to operate on the zip archive files.

The Archive API is mandatory for both Tizen mobile and wearable profiles, which means that it is supported in all mobile and wearable devices. The Archive API is supported on all Tizen Emulators.

To use the Archive API, your application must have the following privileges:

The main features of the Archive API include:

To start any kind of zip operation (packing or unpacking), you must first call the open() method of the ArchiveManager interface (in mobile and wearable applications). The first parameter of is a FileReference object (in mobile and wearable applications), which can be a File object (in mobile and wearable applications) or the virtual path. The second parameter is a FileMode enumerator (in mobile and wearable applications), whose values are described in the following table.

Table: File modes
Mode Description
r Use this mode to extract or get information about the archive file content.

The file must exist, or the NotFoundError exception occurs.

When the archive file is opened in this mode, the add() method is not available.

w Use this mode to create an archive file and add files to it.

If the file does not exist, it is created. If it exists and the overwrite option is true, the existing file is overwritten with an empty archive. If the file exists and the overwrite option is false, the error callback is invoked.

When the archive file is opened in this mode, the getEntries(), getEntryByName(), and extractAll() methods are not available.

rw Use this mode to zip or unzip an archive file.

If the file does not exist, it is created. If it exists and the overwrite option is true, the existing file is overwritten with an empty archive. If the file exists and the overwrite option is false, the existing content is preserved, and both adding and extracting are available.

a Use this mode to add new files to an archive file.

If the file does not exist, it is created. If it exists, the previous content of the archive file is preserved and new files can be added.

When the archive file is opened in this mode, the getEntries(), getEntryByName(), and extractAll() methods are not available.

Go to top