As a general rule, I recommend using the "Unix" format for filesystem paths, even when the OS is Windows. It's more portable, and the backslash has another and nastier meaning in
Java, so the forward slashes are safer. In a database, however, this isn't always desirable, since non-java apps might want to use that path as well. Windows apps will
sometimes honor filepaths in Unix format, but the rules are not real clear on when.
Also, the java.io.File class has some vary useful functions for putting together and pulling apart filename paths., You can use them instead of brute-force
string operations and they're much tidier. It took me quite a while to realize that "File" in java actually refers more to the filename path than it does to the data (or directory) behind that path.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.