public class RelativePath extends Object
Modifier and Type | Method and Description |
---|---|
static List |
getPathElements(File file)
Get a list of the files individual path elements.
|
static String |
getRelativePath(File homeDirectory,
File fileToMakeRelative)
get relative path of fileToMakeRelative with respect to the homeDirectory
|
public static String getRelativePath(File homeDirectory, File fileToMakeRelative)
homeDirectory
- base directoryfileToMakeRelative
- File we are generating the relative pathpublic static List getPathElements(File file)
For example, "/a/b/c/d.txt", will return [d.txt,c,b,a]
Note: on Windows, "c:\foo.txt" will return [foo.txt, ] because c:\ has no name.
file
- input fileCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.