Object built-in object

Object ZipFile

zip File access object

Inheritance

#lineWidth: 1.5 #font: Helvetica,sans-Serif #fontSize: 10 #leading: 1.6 #.this: fill=lightgray #.class: fill=white [<class>object|toString();toJSON()] [<this>ZipFile|namelist();infolist();getinfo();read();readAll();extract();extractAll();write();close()] [object] <:- [ZipFile] object toString() toJSON() ZipFile namelist() infolist() getinfo() read() readAll() extract() extractAll() write() close()

Member function

namelist

Get a list of file names

1
NArray ZipFile.namelist() async;

Return result:

  • NArray, Returns a list object containing the file name

infolist

Get file information list

1
NArray ZipFile.infolist() async;

Return result:

  • NArray, Returns a list object containing file information

File information contains fields: filename, date, compress_type, compress_size, file_size, password, data


getinfo

Get file information

1
NObject ZipFile.getinfo(String member) async;

Call parameters:

  • member: String, specify the file name to obtain information

Return result:

  • NObject, Return file information object

File information contains fields: filename, date, compress_type, compress_size, file_size, password, data


read

Return data read from compressed file

1 2
Buffer ZipFile.read(String member, String password = "") async;

Call parameters:

  • member: String, specify the file name to be read
  • password: String, unzip password, no password by default

Return result:

  • Buffer, Return all the data of the file

readAll

Unzip all files

1
NArray ZipFile.readAll(String password = "") async;

Call parameters:

  • password: String, unzip password, no password by default

Return result:

  • NArray, Contains a list of all file data and information

extract

Unzip the specified file

1 2 3
ZipFile.extract(String member, String path, String password = "") async;

Call parameters:

  • member: String, specify the name of the file to be decompressed
  • path: String, specify the path to decompress to
  • password: String, unzip password, no password by default

Unzip the specified file to the stream

1 2 3
ZipFile.extract(String member, SeekableStream strm, String password = "") async;

Call parameters:

  • member: String, specify the name of the file to be decompressed
  • strm: SeekableStream, Specify the stream to be decompressed
  • password: String, unzip password, no password by default

extractAll

Unzip all files to the specified path

1 2
ZipFile.extractAll(String path, String password = "") async;

Call parameters:

  • path: String, specify the path to decompress to
  • password: String, unzip password, no password by default

write

Write the specified file to the compressed file

1 2 3
ZipFile.write(String filename, String inZipName, String password = "") async;

Call parameters:

  • filename: String, specify the file to be written
  • inZipName: String, compressed inzipFile name within the file
  • password: String, unzip password, no password by default

Write the specified file to the compressed file

1 2 3
ZipFile.write(Buffer data, String inZipName, String password = "") async;

Call parameters:

  • data: Buffer, Specify the file data to be written
  • inZipName: String, compressed inzipFile name within the file
  • password: String, unzip password, no password by default

Write the specified file to the compressed file

1 2 3
ZipFile.write(SeekableStream strm, String inZipName, String password = "") async;

Call parameters:

  • strm: SeekableStream, Specify the data stream to be written to the file
  • inZipName: String, compressed inzipFile name within the file
  • password: String, unzip password, no password by default

close

Close openzipdocument

1
ZipFile.close() async;

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String ZipFile.toString();

Return result:

  • String, Returns the string representation of the object

toJSON

Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object

1
Value ZipFile.toJSON(String key = "");

Call parameters:

  • key: String, unused

Return result:

  • Value, Returns a value containing JSON serializable