模块 ringo / zip

该模块提供了解压缩 zip 文件和流的类。

Functions

Class ZipFile

Instance Methods

Instance Properties


ZipFile (path)

一个类,用于读取和解压缩本地 zip 文件。

Parameters

String path

the location of the zip file


ZipFile.prototype. close ()

关闭压缩文件。


ZipFile.prototype. entries

包含此 zip 文件中所有条目名称的数组。


ZipFile.prototype. getSize (name)

返回给定条目中的未压缩大小(以字节为单位),如果未知则返回-1。

Parameters

String name

the entry name


ZipFile.prototype. getTime (name)

返回给定条目的上次修改时间戳,如果不可用,则返回-1。

Parameters

String name

the entry name


ZipFile.prototype. isDirectory (name)

如果具有给定名称的条目表示一个目录,则返回 true。

Parameters

String name

the entry name


ZipFile.prototype. isFile (name)

如果具有给定名称的条目表示文件,则返回true。

Parameters

String name

the entry name


ZipFile.prototype. open (name)

获取输入流以读取具有给定名称的条目。

Parameters

String name

the entry name


ZipIterator (resource)

通过压缩文件或流的流式迭代器。这个迭代器产生的每个项目都是一个输入流,用于读取一个 zip 条目。每个入口流都具有附加名称,isDirectory,isFile,size 和 time 属性,它们与 ZipFile 中相应方法的语义相同。

Parameters

Stream|String resource

an input stream or file name

See