Class Path
Path validation functions.
Methods summary
public static
boolean
|
#
isValid( string $path )
Return whether the given path is a valid Dropbox path.
Return whether the given path is a valid Dropbox path.
Parameters
- $path
- The path you want to check for validity.
Returns
boolean Whether the path was valid or not.
|
public static
boolean
|
#
isValidNonRoot( string $path )
Return whether the given path is a valid non-root Dropbox path.
This is the same as Dropbox\Path::isValid() except "/" is not allowed.
Return whether the given path is a valid non-root Dropbox path.
This is the same as Dropbox\Path::isValid() except "/" is not allowed.
Parameters
- $path
- The path you want to check for validity.
Returns
boolean Whether the path was valid or not.
|
public static
string|null
|
#
findError( string $path )
If the given path is a valid Dropbox path, return null ,
otherwise return an English string error message describing what is wrong with the path.
If the given path is a valid Dropbox path, return null ,
otherwise return an English string error message describing what is wrong with the path.
Parameters
- $path
- The path you want to check for validity.
Returns
string|null If the path was valid, return null . Otherwise, returns
an English string describing the problem.
|
public static
string|null
|
#
findErrorNonRoot( string $path )
If the given path is a valid non-root Dropbox path, return null ,
otherwise return an English string error message describing what is wrong with the path.
This is the same as Dropbox\Path::findError() except "/" will yield an error message.
If the given path is a valid non-root Dropbox path, return null ,
otherwise return an English string error message describing what is wrong with the path.
This is the same as Dropbox\Path::findError() except "/" will yield an error message.
Parameters
- $path
- The path you want to check for validity.
Returns
string|null If the path was valid, return null . Otherwise, returns
an English string describing the problem.
|
public static
null|string
|
#
getName( string $path )
Return the last component of a path (the file or folder name).
Return the last component of a path (the file or folder name).
Path::getName("/Misc/Notes.txt")
Path::getName("/Misc")
Path::getName("/")
Parameters
- $path
- The full path you want to get the last component of.
Returns
null|string The last component of $path or null if the given
$path was "/" .
|