Language version: | ActionScript 3.0
|
The ZipEntry class is used to represent a single file within a zip archive.
ZipEntry objects can be created from File
or ByteArray
objects,
and contain settings that determine how they are then stored within a ZipArchive
.
Since a ZipEntry
object can be associated with multiple ZipArchive
objects,
care needs to be taken if the contents are changed. Generally it would be better practice to use
different instances in different archives, so a clone()
method is provided to create a
new ZipEntry
object as a copy of an existing one.
Each entry in a zip archive is identified by a name which can include a series of folders,
each folder name is separated using a forward-slash (/
) character. Entries can either
be stored, or compressed using the 'deflate' mechanism. The entry data is provided as a ByteArray
object which is always uncompressed when in memory - i.e. the compression mechanism is only applied when
the zip entry is being written into a zip archive. When reading a zip file, the data is only uncompressed
when it is read (i.e. when the data
property is first accessed).
compress:Boolean
[read-write]
Language version: | ActionScript 3.0
|
Whether or not the data will be compressed when it is stored into an archive.
Note that this doesn't give the status of the data when accessed via
ActionScript: the byte array that you can access and manipulate via the
data
property is always the normal, uncompressed data. This flag
just determines whether this data is compressed during the creation of a
ZipArchive
object when this is saved to a file/stream.
Implementation
public function get compress():Boolean
public function set compress(value:Boolean):void
data:ByteArray
[read-write]
Language version: | ActionScript 3.0
|
The (raw/uncompressed) data contained within this zip entry.
Implementation
public function get data():ByteArray
public function set data(value:ByteArray):void
flags:uint
[read-write]
Language version: | ActionScript 3.0
|
The external attribute flags for this zip entry.
These can be used to set file types and permissions, especially in order
to create a symbolic link on operating systems that support this.
Implementation
public function get flags():uint
public function set flags(value:uint):void
modified:Date
[read-write]
Language version: | ActionScript 3.0
|
The 'last modified' date/time for this entry, which will determine the file
time set on an entry if it is unzipped to a file.
This can be left as a null value, which would result in the operating system
setting the last modified time as the point at which the file is created during
an unzip operation. Or if set, this should result in the file modification date
being set to this value once the file is unzipped.
Implementation
public function get modified():Date
public function set modified(value:Date):void
name:String
[read-write]
Language version: | ActionScript 3.0
|
The name of the entry (including folder structure where required)
Implementation
public function get name():String
public function set name(value:String):void
public function ZipEntry(name:String, compress:Boolean = true)
Language version: | ActionScript 3.0
|
Creates a new zip entry, with optional parameters to set the name and storage type.
Parameters
public function clone():ZipEntry
Language version: | ActionScript 3.0
|
Clones a zip entry to create a new object with the same settings/data,
but with these efficiently copied so that the new object is independent.
Returns
| ZipEntry —
A new ZipEntry object with identical settings and data.
|
public static function createFromFile(file:File, compress:Boolean):ZipEntry
Language version: | ActionScript 3.0
|
Creates a zip entry based on a file from the file system.
Parameters
Returns
public static const DIRECTORY:uint = 0x40000000
Language version: | ActionScript 3.0
|
Flag value for a directory entry
public static const FILE:uint = 0x80000000
Language version: | ActionScript 3.0
|
Flag value for a file entry
public static const GROUP_EXECUTE:uint = 0x00080000
Language version: | ActionScript 3.0
|
Flag value for group-execute permission
public static const GROUP_READ:uint = 0x00200000
Language version: | ActionScript 3.0
|
Flag value for group-read permission
public static const GROUP_WRITE:uint = 0x00100000
Language version: | ActionScript 3.0
|
Flag value for group-write permission
public static const LINK:uint = 0x20000000
Language version: | ActionScript 3.0
|
Flag value for a symbolic link entry
public static const OTHER_EXECUTE:uint = 0x00010000
Language version: | ActionScript 3.0
|
Flag value for other-execute permission
public static const OTHER_READ:uint = 0x00040000
Language version: | ActionScript 3.0
|
Flag value for other-read permission
public static const OTHER_WRITE:uint = 0x00020000
Language version: | ActionScript 3.0
|
Flag value for other-write permission
public static const OWNER_EXECUTE:uint = 0x00400000
Language version: | ActionScript 3.0
|
Flag value for owner-execute permission
public static const OWNER_READ:uint = 0x01000000
Language version: | ActionScript 3.0
|
Flag value for owner-read permission
public static const OWNER_WRITE:uint = 0x00800000
Language version: | ActionScript 3.0
|
Flag value for owner-write permission
© 2004-2022 Adobe Systems Incorporated. All rights reserved.
Thu Mar 21 2024, 10:06 AM GMT