This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
built_in:zip [2014/12/18 21:38] bcarroll [Methods] |
built_in:zip [2015/03/21 17:36] octazid [Methods] sorted |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== ZipUtil control ====== | ====== ZipUtil control ====== | ||
===== Create ===== | ===== Create ===== | ||
- | Create a ZipUtil control using the CreateZipUtil function of the app object: | + | Create a ZipUtil control using the CreateZipUtil function of the [[built_in:app|app]] |
< | < | ||
Also you can use it in a function like this: | Also you can use it in a function like this: | ||
- | < | + | < |
+ | function unzip(zipfile, | ||
+ | { | ||
var zip = app.CreateZipUtil(); | var zip = app.CreateZipUtil(); | ||
zip.Open(zipfile); | zip.Open(zipfile); | ||
var files = zip.List().split("," | var files = zip.List().split("," | ||
- | files.forEach(function (item) { | + | files.forEach(function (item) |
+ | | ||
zip.Extract(item, | zip.Extract(item, | ||
}); | }); | ||
Line 16: | Line 19: | ||
===== Methods ===== | ===== Methods ===== | ||
^Method ^Description ^ | ^Method ^Description ^ | ||
- | |ZipUtil.Open( file ) | | | ||
- | |ZipUtil.Create( file ) | | | ||
- | |ZipUtil.Close() | | | ||
- | |ZipUtil.List( path ) | | | ||
- | |ZipUtil.Extract( name,file ) | | | ||
|ZipUtil.AddFile( name,file ) | | | |ZipUtil.AddFile( name,file ) | | | ||
|ZipUtil.AddText( name,text ) | | | |ZipUtil.AddText( name,text ) | | | ||
- | |ZipUtil.CreateKey( file, | + | |ZipUtil.Close() | | |
+ | |ZipUtil.Create( file ) | | | ||
|ZipUtil.CreateDebugKey( file ) | | | |ZipUtil.CreateDebugKey( file ) | | | ||
+ | |ZipUtil.CreateKey( file, | ||
+ | |ZipUtil.Extract( name,file ) | | | ||
+ | |ZipUtil.List( path ) | | | ||
+ | |ZipUtil.Open( file ) | | | ||
|ZipUtil.Sign( fileIn, | |ZipUtil.Sign( fileIn, | ||
|ZipUtil.UpdateManifest( fileIn, fileOut, packageName, | |ZipUtil.UpdateManifest( fileIn, fileOut, packageName, |