title: Is there a Java utility which will convert a String path to use the correct File separator char?
body: <p>I have developed a number of classes which manipulate files in Java. I am working on a Linux box, and have been blissfully typing <code>new File("path/to/some/file");</code>. When it came time to commit I realised some of the other developers on the project are using Windows. I would now like to call a method which can take in a String of the form <code>"/path/to/some/file"</code> and, depending on the OS, return a correctly separated path. </p>
  
  <p>For example:<br>
  <code>"path/to/some/file"</code> becomes <code>"path\\to\\some\\file"</code> on Windows.<br>
  On Linux it just returns the given String.</p>
  
  <p>I realise it wouldn't take long to knock up a regular expression that could do this, but I'm not looking to reinvent the wheel, and would prefer a properly tested solution. It would be nice if it was built in to the JDK, but if it's part of some small F/OSS library that's fine too.</p>
  
  <p>So is there a Java utility which will convert a String path to use the correct File separator char?</p>