public final class FileSystemPathUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.BitSet |
SAFE_NAMECHARS
The list of characters that are not encoded by the
escapeName(String)
and unescape(String) methods. |
static java.util.BitSet |
SAFE_PATHCHARS
The list of characters that are not encoded by the
escapePath(String)
and unescape(String) methods. |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkFormat(java.lang.String path)
Checks if
path is a valid path. |
static boolean |
denotesRoot(java.lang.String path)
Tests whether the specified path represents the root path, i.e.
|
static java.lang.String |
escapeName(java.lang.String name)
Encodes the specified
name. |
static java.lang.String |
escapePath(java.lang.String path)
Encodes the specified
path. |
static java.lang.String |
getName(java.lang.String path)
Returns the name of the specified
path. |
static java.lang.String |
getParentDir(java.lang.String path)
Returns the parent directory of the specified
path. |
static java.lang.String |
unescape(java.lang.String pathOrName)
Decodes the specified path/name.
|
public static final java.util.BitSet SAFE_NAMECHARS
escapeName(String)
and unescape(String) methods. They contains the characters
which can safely be used in file names:public static final java.util.BitSet SAFE_PATHCHARS
escapePath(String)
and unescape(String) methods. They contains the characters
which can safely be used in file paths:public static java.lang.String escapePath(java.lang.String path)
path. Same as
escapeName(String) except that the separator
character / is regarded as a legal path character
that needs no escaping.path - the path to encode.public static java.lang.String escapeName(java.lang.String name)
name. Same as
escapePath(String) except that the separator character
/ is regarded as an illegal character that needs
escaping.name - the name to encode.public static java.lang.String unescape(java.lang.String pathOrName)
pathOrName - the escaped path/namepublic static boolean denotesRoot(java.lang.String path)
path - path to testpublic static void checkFormat(java.lang.String path)
throws FileSystemException
path is a valid path.path - the path to be checkedFileSystemException - If path is not a valid pathpublic static java.lang.String getParentDir(java.lang.String path)
path.path - a file system path denoting a directory or a file.public static java.lang.String getName(java.lang.String path)
path.path - a file system path denoting a directory or a file.Copyright © 2010 - 2023 Adobe. All Rights Reserved