PathDriver Class
A utility library for processing file paths. Handles any type of file path so long as the separator is "/"
For ItemMirror core developers only. Enable protected to see.
Item Index
Methods
_stripLeadingSlash
(
String
private
-
path
Parameters:
-
path
String
Returns:
String:
The path without any leading slash
_stripTrailingSlash
(
String
private
-
path
Parameters:
-
path
String
Returns:
String:
The path without any trailing slash
formatPath
(
String
protected
-
path
Formats a path by removing any trailing slashes.
Parameters:
-
path
StringThe path to be formatted
Returns:
String:
The well formatted path
Example:
format('/foo/bar/');
// returns '/foo/bar'
getPathSeparator
()
String
protected
Returns:
String:
The character that is used as a path separator
Example:
getPathSeparator();
// returns '/'
isRoot
(
Boolean
protected
-
path
Parameters:
-
path
StringPath to test for root
Returns:
Boolean:
True if root, false otherwise
Example:
format('/');
// returns true, anything else will return false
joinPath
(
String
protected
-
root
-
leaf
Takes two paths and joins them together.
Returns:
String:
The two joined paths
Example:
joinPath('/foo/', '/bar/');
// returns '/foo/bar/'
joinPathArrays
()
protected
Takes an array of paths and joins them all together.
Currently unimplemented and throws notImplemented exception if called.