Is there a Java utility which will convert a String path to use the correct File separator char?
Apache Commons comes to the rescue (again). The Commons IO method FilenameUtils.separatorsToSystem(String path) will do what you want. Needless to say, Apache Commons IO will do a lot more besides and is worth looking at.