code: public static String path2unix(String path)
    {
      if(path == null) {
        return null;
      }
      if(path.endsWith("/") || path.endsWith("\\")) {
        path = path.substring(0, path.length() - 1);
      }
      return path.replaceAll("(^[a-zA-Z]\\:\\\\?)?\\\\", "/");
    }
docs: Convert file path to an Unix like path string. If given <code>path</code> is Windows like replaces drive letter
  with Unix path root and all Windows path separators to Unix counterpart.
  
  <pre>
  D:\\temp\file.txt -&gt; /temp/file.txt
  </pre>
  
  If <code>path</code> is already Unix like this method leave it as it is but remove trailing path separator, if any.
  Returns null if <code>path</code> parameter is null.
  
  @param path path to convert, trailing path separator ignored.
  @return Unix like path string or null.