[Project_owners] Reading contents of a file in a jar

Pete Collins pete at mozdevgroup.com
Fri Sep 10 10:56:03 EDT 2004


> How can I read the contents of a file that is stored in a jar file? 
> Would appreciate a pointer and / or code snippet.
>
jsLib now has support for this.

Docs w/ samples:

  http://jslib.mozdev.org/libraries/zip/zip.js.html

Ver 0.1.192

code sample:

// *************
include (jslib_zip);
var p = "/mozilla/chrome/jslib.jar";
var z = new Zip(p);

var contents = z.readEntry("samples/file.xul");
jslibPrint(contents);
z.close();
// *************


--pete

-- 
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions 




More information about the Project_owners mailing list