xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Duncan Davidson <james.david...@eng.sun.com>
Subject Re: [Proposal] Guidlines for package distribution of Java projects:like XMLfile being read by class
Date Thu, 25 Nov 1999 20:12:11 GMT
Robert_Weir@lotus.com wrote:
> Yes, there are some nasty security issues with getResource and
> getSystemResource.  Some environments, like Netscape, have disabled these
> functions and just return null.  But I just use getResourceAsStream and it
> seems to work correctly everywhere.  It is slightly surprising, but from
> what I can determine, getResourceAsStream in Netscape does not just turn
> around and call getResource().

In the getResource case, you are asking for a URL object, in the second
case, you are just asking for a stream. From writing classloaders, I can
tell you from experience that providing a stream to a resource is easy.
Constructing a URL is fairly easy, but gets problematic as the URL has
to be able to look inside a Jar, zip, or somewhere else. Yech.

-- 
James Davidson                                     duncan@eng.sun.com 
Java + XML / Portable Code + Portable Data                 !try; do()

Mime
View raw message