URL and/or ClassLoader problem [message #443671] |
Thu, 02 February 2006 18:27 |
Paul E. Keyser Messages: 878 Registered: July 2009 |
Senior Member |
|
|
R3.1.1, WinXP
So, I have a valid URL, that points to a valid directory, in one of my RCP plugins, containing some
"resource" (readonly) files; its string rep looks like this:
file:/c:/LOCATION/eclipse/workspace/com.foo.bar.some.plugin/ subdirectory/txt
Now, I want to create from that URL a valid URL for a specific file in that directory, so I can read
it, e.g., by calling fileURL.openStream(), and using the InputStream. So, I try this, where
"validURL" is my URL as above:
new URL(validURL, "filename.ext");
That fails! It gives me a URL that is bogus, whose String-rep is:
file:/c:/LOCATION/eclipse/workspace/com.foo.bar.some.plugin/ subdirectory/filename.ext
What does work is this:
new URL(validURL, "txt/" + "filename.ext");
But hardwiring in that "txt/" is clearly a Bad Thing -- so what am I doing wrong here?
thanks,
Paul
|
|
|
|
Powered by
FUDForum. Page generated in 0.04111 seconds