public class FileTreeUtil
extends java.lang.Object
FileTree
and manage paths.Constructor and Description |
---|
FileTreeUtil() |
Modifier and Type | Method and Description |
---|---|
static <T extends ContentMeta> |
forRoot(java.io.File root,
ContentFactory<T> factory) |
static Path |
pathForFileInRoot(java.io.File rootDir,
java.io.File file)
Return a storage Path given a file within a given root dir
|
static Path |
pathForRelativeFilepath(java.lang.String filepath)
Return a storage path given a relative file path string, using the native file path
separator.
|
static Path |
pathForRelativeFilepath(java.lang.String filepath,
java.lang.String separator)
Return a storage path given a relative file path string
|
public static <T extends ContentMeta> FileTree<T> forRoot(java.io.File root, ContentFactory<T> factory)
public static Path pathForFileInRoot(java.io.File rootDir, java.io.File file)
rootDir
- root dir to usefile
- filejava.lang.IllegalArgumentException
- if the file is not within the rootpublic static Path pathForRelativeFilepath(java.lang.String filepath)
filepath
- file path with native file separatorpublic static Path pathForRelativeFilepath(java.lang.String filepath, java.lang.String separator)
filepath
- file path with given separatorseparator
- separator string