public class RootDirectory extends Object
Constructor and Description |
---|
RootDirectory(File root)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
File |
getAbsoluteFile(File file)
Makes sure that we have an absolute file path, using the root directory
as the start if the supplied path is relative.
|
File |
getFile(String... parts)
Constructs a path from the root directory.
|
File |
getRelativeFile(File file)
If the file is under to the root directory, returns a relative path.
|
String |
getRelativePath(File file)
If the file is under to the root directory, returns a relative path.
|
String |
getRelativePath(String path)
If the path is under to the root directory, returns a relative path.
|
File |
getRoot()
The root directory.
|
public RootDirectory(File root)
root
- The root directorypublic File getRoot()
public File getFile(String... parts)
parts
- The path partspublic File getAbsoluteFile(File file)
file
- The filegetRelativeFile(File)
public File getRelativeFile(File file)
file
- The absolute filegetAbsoluteFile(File)
,
getRelativePath(String)
public String getRelativePath(File file)
file
- The absolute filegetRelativeFile(File)
,
getRelativePath(File)
public String getRelativePath(String path)
path
- The absolute pathgetRelativePath(File)
Copyright © 2011-2016 Three Crickets LLC.