Fix wrong relativized path
This commit is contained in:
@@ -80,7 +80,7 @@ public class FileItem extends BorderPane {
|
|||||||
Path given = Paths.get(path).toAbsolutePath();
|
Path given = Paths.get(path).toAbsolutePath();
|
||||||
if (isConvertToRelativePath()) {
|
if (isConvertToRelativePath()) {
|
||||||
try {
|
try {
|
||||||
return Paths.get(".").toAbsolutePath().relativize(given).normalize().toString();
|
return Paths.get(".").normalize().toAbsolutePath().relativize(given).normalize().toString();
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// the given path can't be relativized against current path
|
// the given path can't be relativized against current path
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user