Object built-in object

Object ZipFile

zip file access object

Inheritance

Member function

namelist

Get a list of file names

1
NArray ZipFile.namelist() async;

Return result:

  • NArray , returns a list object containing file names

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, decompression 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, decompression 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 file name to be decompressed
  • path : String, specify the path to decompress to
  • password : String, decompression 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 file name to be decompressed
  • strm : SeekableStream , specify the stream to be decompressed
  • password : String, decompression 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, decompression 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, the file name compressed in the zip file
  • password : String, decompression 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, the file name compressed in the zip file
  • password : String, decompression 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, the file name compressed in the zip file
  • password : String, decompression password, no password by default

close

Close the opened zip file

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