Packageair.utils
Classpublic class ZipEntry
InheritanceZipEntry Inheritance Object

Language version: ActionScript 3.0
Runtime version: AIR 51

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



Public Properties
 PropertyDefined by
  compress : Boolean
Whether or not the data will be compressed when it is stored into an archive.
ZipEntry
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  data : ByteArray
The (raw/uncompressed) data contained within this zip entry.
ZipEntry
  flags : uint
The external attribute flags for this zip entry.
ZipEntry
  modified : Date
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.
ZipEntry
  name : String
The name of the entry (including folder structure where required)
ZipEntry
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined by
  
ZipEntry(name:String, compress:Boolean = true)
Creates a new zip entry, with optional parameters to set the name and storage type.
ZipEntry
  
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.
ZipEntry
  
[static] Creates a zip entry based on a file from the file system.
ZipEntry
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined by
  DIRECTORY : uint = 0x40000000
[static] Flag value for a directory entry
ZipEntry
  FILE : uint = 0x80000000
[static] Flag value for a file entry
ZipEntry
  GROUP_EXECUTE : uint = 0x00080000
[static] Flag value for group-execute permission
ZipEntry
  GROUP_READ : uint = 0x00200000
[static] Flag value for group-read permission
ZipEntry
  GROUP_WRITE : uint = 0x00100000
[static] Flag value for group-write permission
ZipEntry
  LINK : uint = 0x20000000
[static] Flag value for a symbolic link entry
ZipEntry
  OTHER_EXECUTE : uint = 0x00010000
[static] Flag value for other-execute permission
ZipEntry
  OTHER_READ : uint = 0x00040000
[static] Flag value for other-read permission
ZipEntry
  OTHER_WRITE : uint = 0x00020000
[static] Flag value for other-write permission
ZipEntry
  OWNER_EXECUTE : uint = 0x00400000
[static] Flag value for owner-execute permission
ZipEntry
  OWNER_READ : uint = 0x01000000
[static] Flag value for owner-read permission
ZipEntry
  OWNER_WRITE : uint = 0x00800000
[static] Flag value for owner-write permission
ZipEntry
Property detail
compressproperty
compress:Boolean  [read-write]

Language version: ActionScript 3.0
Runtime version: AIR 51

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
dataproperty 
data:ByteArray  [read-write]

Language version: ActionScript 3.0
Runtime version: AIR 51

The (raw/uncompressed) data contained within this zip entry.

Implementation
    public function get data():ByteArray
    public function set data(value:ByteArray):void
flagsproperty 
flags:uint  [read-write]

Language version: ActionScript 3.0
Runtime version: AIR 51

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
modifiedproperty 
modified:Date  [read-write]

Language version: ActionScript 3.0
Runtime version: AIR 51

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
nameproperty 
name:String  [read-write]

Language version: ActionScript 3.0
Runtime version: AIR 51

The name of the entry (including folder structure where required)

Implementation
    public function get name():String
    public function set name(value:String):void
Constructor detail
ZipEntry()constructor
public function ZipEntry(name:String, compress:Boolean = true)

Language version: ActionScript 3.0
Runtime version: AIR 51

Creates a new zip entry, with optional parameters to set the name and storage type.

Parameters
name:String
 
compress:Boolean (default = true)
Method detail
clone()method
public function clone():ZipEntry

Language version: ActionScript 3.0
Runtime version: AIR 51

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.
createFromFile()method 
public static function createFromFile(file:File, compress:Boolean):ZipEntry

Language version: ActionScript 3.0
Runtime version: AIR 51

Creates a zip entry based on a file from the file system.

Parameters
file:File
 
compress:Boolean

Returns
ZipEntry
Constant detail
DIRECTORYconstant
public static const DIRECTORY:uint = 0x40000000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for a directory entry

FILEconstant 
public static const FILE:uint = 0x80000000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for a file entry

GROUP_EXECUTEconstant 
public static const GROUP_EXECUTE:uint = 0x00080000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for group-execute permission

GROUP_READconstant 
public static const GROUP_READ:uint = 0x00200000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for group-read permission

GROUP_WRITEconstant 
public static const GROUP_WRITE:uint = 0x00100000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for group-write permission

LINKconstant 
public static const LINK:uint = 0x20000000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for a symbolic link entry

OTHER_EXECUTEconstant 
public static const OTHER_EXECUTE:uint = 0x00010000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for other-execute permission

OTHER_READconstant 
public static const OTHER_READ:uint = 0x00040000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for other-read permission

OTHER_WRITEconstant 
public static const OTHER_WRITE:uint = 0x00020000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for other-write permission

OWNER_EXECUTEconstant 
public static const OWNER_EXECUTE:uint = 0x00400000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for owner-execute permission

OWNER_READconstant 
public static const OWNER_READ:uint = 0x01000000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for owner-read permission

OWNER_WRITEconstant 
public static const OWNER_WRITE:uint = 0x00800000

Language version: ActionScript 3.0
Runtime version: AIR 51

Flag value for owner-write permission