public final class FileSystemUtility extends Object
Modifier and Type | Method | Description |
---|---|---|
static void |
deleteFiles(FileSystem aFileSystem,
String aPath,
boolean isRecursively) |
Deletes the entries found for the given path.
|
static String |
getName(String aKey) |
Gets the name portion from the provided key (the key without the path
portion).
|
static String |
getPath(String aKey) |
Gets the path portion from the provided key (the key without the name
portion).
|
static String |
toKey(String aPath,
String aName) |
Creates a key from the given path portion and name portion.
|
static FileHandle |
toNormalizedFileHandle(FileHandle aFileHandle,
FileSystem aFileSystem) |
Test whether the given key may jail break from the name space.
|
static String |
toNormalizedKey(String aKey,
FileSystem aFileSystem) |
Truncates any prefixed path separator as we assemble our new path with
the according namespace in front.
|
static String |
toNormalizedName(String aName,
FileSystem aFileSystem) |
Truncates any prefixed path separator as we assemble our new path with
the according namespace in front.
|
static String |
toNormalizedPath(String aPath) |
Normalizes the given path.
|
static String |
toNormalizedPath(String aPath,
FileSystem aFileSystem) |
Truncates any prefixed path separator as we assemble our new path with
the according namespace in front.
|
static String |
toTruncated(String aPath) |
Truncates any prefixed path separator as we assemble our new path with
the according namespace in front.
|
public static String toNormalizedPath(String aPath)
aPath
- The path to be normalizedpublic static String getName(String aKey)
aKey
- The key from which to get the name portionpublic static String getPath(String aKey)
aKey
- The key from which to get the path portionpublic static String toKey(String aPath, String aName)
aPath
- The path to useaName
- The name to usepublic static void deleteFiles(FileSystem aFileSystem, String aPath, boolean isRecursively)
aFileSystem
- the file systemaPath
- The path where to look whether there are file (handle)s or
not.isRecursively
- When true all children of that path are examined as
well.public static String toTruncated(String aPath)
aPath
- The path to truncate.public static String toNormalizedPath(String aPath, FileSystem aFileSystem) throws IllegalPathException
IllegalPathException
is thrown.aPath
- The path to be checked.aFileSystem
- The file system to use to get additional information.IllegalPathException
- in case the path may jail break the name
space.public static String toNormalizedKey(String aKey, FileSystem aFileSystem) throws IllegalKeyException
IllegalKeyException
is thrown.aKey
- The key to be checked.aFileSystem
- The file system to use to get additional information.IllegalKeyException
- in case the key may jail break the name
space.public static String toNormalizedName(String aName, FileSystem aFileSystem) throws IllegalNameException
IllegalKeyException
is thrown.aName
- The key to be checked.aFileSystem
- The file system to use to get additional information.IllegalNameException
- in case the name may jail break the name
space.public static FileHandle toNormalizedFileHandle(FileHandle aFileHandle, FileSystem aFileSystem) throws IllegalFileHandleException
IllegalKeyException
is thrown.aFileHandle
- The file handle to be checked.aFileSystem
- The file system to use to get additional information.IllegalFileHandleException
- in case the key may jail break the
name space.Copyright © 2018. All rights reserved.