Retrieves the root portion of the specified path.
public static String getRoot( String path )
path
The path of a file or directory.
Returns the root portion of the specified path.
The resulting string consists of the rightmost characters that make up the root of the path. Possible patterns for the resulting string are:
An empty string (a relative path on the current drive).
\ An absolute path on the current drive.
x: A relative path on a specified drive, where x is the drive letter.
x:\ An absolute path on a specified drive.
\\server\share A universal naming convention (UNC) path for a specific server and share name.
The resulting string is null if path is null.
See Also getDirectory, getExtension, getName, isRooted