Retrieves the directory path of a file path.
public static String getDirectory( String path )
path
The path of a file or directory.
Returns the directory path of the specified path, or returns null if the specified path includes a root.
This method effectively removes the last element of the specified file path; for example, it returns a string consisting of all characters up to but not including the last backslash (\) in the file path. The returned value is null if the file path is null or if the file path includes a root, such as backslash (\), C:, or \\server\share.
See Also getExtension, getName, getRoot, isRooted