I'm no I/O guru, so there may be a better way of doing this, but you could write a custom FilterInputStream to convert the black slashes into forward slashes since Java will take C:/test/myfile.txt as a vaild file path for windows. (It would also take C:\\test\\myfile.txt). However to add the extra escape character would take a little bit more work since you need to add a character to the input stream, likely via a BufferedInputStream or BufferedReader.
Here's a quick trial I did that seems to work fine (with very limited testing), converting c:\test\tmp to c:/test/tmp. Of course this will convert ALL '\' characters to '/'. Not a problem if you only have file paths in your properties file, If not, you'll to make it a bit more fancy, perhaps changing all '\' to '\\', but like I said, that gets to be a bit more complicated, but certainly could be done via some type of BufferedReader or Stream.
A demo program:
A sheriff may want to move this to the I/O forum to get some input (no pun intended) from the gurus that hang out in that forum. [ March 15, 2005: Message edited by: Mark Vedder ]
That is a good point, and I agree it is generally better to use a ClassLoader then a a java.io.File to load the properties. I typically do so myself. In the above post, my focus was on the FilterInputStream to solve Yaroslav's problem, and therefore I wrote a quick demo program to illustrate its use. The same technique could be used on the wrap the InputStream received via using a ClassLoader to "find" the properties file.
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it: