-
- if ("\\".equals(File.separator))
- {
- //remove last separator at last position if found
- /* not needed anymore if (path.charAt(path.length() - 1) == '/')path = path.substring(0, path.length() - 1);
- path = path.replaceAll("/", "\\\\");
- */
- int index = path.indexOf(File.separator);
-
- if (index >-1)
- {//separator found, keep last part of the urn - filename
- path = path.substring(index+1, path.length());
- }
- }
- /*shall we use URI or String to create the object*/
- /* from URI : URI.create("file://path") , but first / */
- return new File(path);