[Jslib] Uninstall UI

Pete Collins pete at mozdev.org
Sun Dec 7 10:10:02 EST 2003


Karsten Düsterloh wrote:
> Pete Collins aber hob zu reden an und schrieb:
> 
>>I was looking at getting the zip reader from nsIJARProtocolHandler:
> 
> 
> Oh, I must have missed that one. :O :)
> 
> 
>>But this interface doesn't seem to be used anywhere in Mozilla and 
>>doesn't appear to be available.
> 
> 
> The following code works perfectly for me, doing what you told you intended:

Yea, interesting. "nsIJARProtocolHandler" must be one of those 
interfaces that don't appear in xpcshell. Cool, i'm going to test this 
theory out.


--pete


> 
> 
> var IOService = Components.classes["@mozilla.org/network/io-service;1"]
>                 .getService(Components.interfaces.nsIIOService);
> var handler = IOService.getProtocolHandler("jar");
> if (handler instanceof Components.interfaces.nsIJARProtocolHandler)
> {
> 	var zrc = jph.JARCache;
> 	var nsIZipReader = zrc.getZip(<some nsIFile zipFile>);
> }
> 
> 
> But since it calls getZip, I'm still not sure if that will suffice.
> Guess I'll have a dig into nsJar.cpp as soon as I have time... :)
> 
> 
>>There must be a better way to close a file handle on a jar cahced in 
>>memory. It seems sending the observer service and "exhausted memory" 
>>notice is a last resort. :)
> 
> 
> I hope so. :)
> nsIJARProtocolHandler looks very promising.
> 
> 
> Karsten
> _______________________________________________
> Jslib mailing list
> Jslib at mozdev.org
> http://mozdev.org/mailman/listinfo/jslib
> 


-- 
Pete Collins
www.mozdev.org
www.mozdevgroup.com



More information about the Jslib mailing list