Re: loading files from a jar
- From: Roedy Green <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx>
- Date: Mon, 31 Oct 2005 10:19:32 GMT
On Thu, 27 Oct 2005 11:10:23 -0400, frank <fgeck@xxxxxxxxxxxxx> wrote,
quoted or indirectly quoted someone who said :
>Had something working just fine when the files where on the local file
>system but now that I have them in a jar it's not working. I believe
>the paths are correct just seems to be going to the local file system
>and not the jar file.
It is behaving as advertised.
you are doing effectively
new StreamSource( "xss/style.xsl" );
StreamSource is expecting an URL, e.g. the result of a getResource.
You gave it a relative URL which I presume it is interpreting as:
file:xxx/style.xsl
a file in the CWD of the local file system, not a resource.
Try feeding the rnesult of a getResourceAsStream(" xss/style.xsl" );
instead where that file is stored under the current package name in
the jar.
http://mindprod.com/jgloss/image.html
and
http://mindprod.com/jgloss/resource.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.
- Prev by Date: Re: Java Libray to extract email Contact Only from Outlook file
- Next by Date: Re: How stable is 1.5?
- Previous by thread: Re: Strange behaviour of Applet.getImage(URL)
- Next by thread: Re: Detect if Sun plugin is installed (in IE) EVEN if not set as default in plugin?
- Index(es):
Relevant Pages
|