Wierd webstart problem

I’m loading a text file in my application and it works on OS X with webstart, but fails on windows (also fails when just running it from jar) (java 1.4.2)

I use the following code to retrieve URLs:

URL url = Thread.currentThread().getContextClassLoader().getResource(fileName);

The text file is loaded from a seperate jar in my classpath.

I use the following rather funky line to get my text file:

BufferedReader input = new BufferedReader(new InputStreamReader(resMgr.getResourceAsStream(Globals.CLIENT_DATA_PATH + “textures.txt”)));

It appears that getResourceAsStream returns null;
In getResourceAsStream I merely get the URL as above and then calls openStream();

Anyone knows what I’m doing wrong here? As stated both cases works on OS X, but not on windows.

Thanks in advance

A return of null normally means file not found.

Kev

Yes I know that, but the wierd thing is that it works on mac. Could be case sensitivity problem. I’ll have to look into it :slight_smile:

Ahh. Easy when you know it.
I used File.separator between my path items.
That’s why it only failed in jars.

On windows the separator is \ and inside jars it must be /

On mac the separator is / so no problem there.

Stupid mistake I only caught thanks to good textfile logging.

Oh well, let it be a lesson to others :slight_smile: