commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Leangen" <dlean...@canada.com>
Subject RE: [Configuration] Problem getting resource in a JAR file
Date Sun, 19 Sep 2004 11:24:08 GMT

It was pointed out to me that I should be using
getClass().getResourceAsStream("file"), rather than
getClass().getResource("file");

Using the inputStream, everything works fine.



> -----Original Message-----
> From: David
> Sent: 19 September 2004 13:13
> To: commons-user@jakarta.apache.org
> Subject: [Configuration] Problem getting resource in a JAR file
>
>
>
> Dear list,
>
> There appears to be a problem locating a resource when the resource is
> located in a JAR file.
>
> The path seems to somehow get used twice, ending up with this URL:
>
> K:\myproject\target\test\file:\K:\myproject\target\deliverables\ja
> rs\my-jar-
> SNAPSHOT.jar!\conf\test.xml
>
>
> When it should (I think) be this URL:
>
> file:\K:\myproject\target\deliverables\jars\my-jar-SNAPSHOT.jar!\c
> onf\test.x
> ml
>
>
>
> Any ideas?
>
> I would gladly send more info, if required.
>
>
> Thanks!
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message