xml
Class PathUtilities

java.lang.Object
  extended by xml.PathUtilities

public final class PathUtilities
extends java.lang.Object

pathToURL() and urlToPath()


Field Summary
static java.util.regex.Pattern unixPattern
          a pattern for UNIX paths e.g.
static java.util.regex.Pattern windowsDrivePattern
          a pattern for standard windows paths, e.g.
static java.util.regex.Pattern windowsUNCPattern
          a pattern for windows UNC e.g.
 
Constructor Summary
PathUtilities()
           
 
Method Summary
static java.lang.String pathToURL(java.lang.String path)
           
static java.lang.String urlToPath(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

windowsDrivePattern

public static final java.util.regex.Pattern windowsDrivePattern
a pattern for standard windows paths, e.g. : C:\temp\MyClass.java


windowsUNCPattern

public static final java.util.regex.Pattern windowsUNCPattern
a pattern for windows UNC e.g. : \\localhost\SHARED_C\temp\MyClass.java and long UNC, e.g. : \\?\UNC\localhost\SHARED_C\temp\MyClass.java \\?\C:\temp\MyClass.java


unixPattern

public static final java.util.regex.Pattern unixPattern
a pattern for UNIX paths e.g. : /tmp/MyClass.java

Constructor Detail

PathUtilities

public PathUtilities()
Method Detail

pathToURL

public static java.lang.String pathToURL(java.lang.String path)
Parameters:
path - UNIX/Windows path or VFS path
Returns:
path having a scheme

urlToPath

public static java.lang.String urlToPath(java.lang.String url)
Parameters:
url - file:/ url. All illegal characters are required to be escaped, likely by a call to File.toURI().toURL()
Returns:
path without Scheme