views:

213

answers:

1

I tried to get a resource from a file path from a properties file.

Property File:

info_path=c:\Info\output

Java:

String path = ResourceBundle.getBundle("bundle_name").getString("info_path");

Result: C:Infooutput

I would need to set the file:

info_path=c:\\Info\\output

Is this the default behavior? or would it depend on the file encoding? The file is using SJIS encoding by the way.

+1  A: 

You are better of using forward slash in your property files, instead of some workaround. By the way no matter you are on Unix/Linux or Windows, forward slash works well, in this context at least. After all Java is platform independent. ;)

P.S. Its better to use relative path.

Adeel Ansari
Thanks. I actually got to the same conclusion too. forward slash is platform independent. :)
Nassign