public class PathDifference extends Object
e.g. if a base is c:\root\somePrefix_
and a file is
c:\root\somePrefix_someFile.xml
then the difference is _someFile.xml
The difference is recorded separately as directory and filename components.
Internally, both paths are converted to absolute paths and URIs.
Modifier and Type | Method and Description |
---|---|
Path |
combined()
The directory-component (if it exists) and filename-component combined.
|
static PathDifference |
differenceFrom(Path baseDirectoryPath,
Path filePath)
Finds the difference between a path and a base.
|
Optional<Path> |
getDirectory()
The directory component of the difference, if it exists.
|
String |
getFilename()
The file-name component of the difference, if it exists.
|
String |
toString() |
public static PathDifference differenceFrom(Path baseDirectoryPath, Path filePath) throws PathDifferenceException
baseDirectoryPath
- path to a base directory.filePath
- the path to resolve.PathDifferenceException
- if the canonical file cannot be found.public Path combined()
public String getFilename()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.