From 9ed32437cdbd78c9e78ac32cfa2e71df44586f11 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 8 Jan 2014 20:03:22 +0000 Subject: [PATCH] * just in case fixy --- source/net/sourceforge/filebot/MetaAttributeView.java | 2 +- source/net/sourceforge/tuned/FileUtilities.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/MetaAttributeView.java b/source/net/sourceforge/filebot/MetaAttributeView.java index a97f7666..9ed455d5 100644 --- a/source/net/sourceforge/filebot/MetaAttributeView.java +++ b/source/net/sourceforge/filebot/MetaAttributeView.java @@ -19,7 +19,7 @@ public class MetaAttributeView extends AbstractMap { private final Charset encoding; public MetaAttributeView(File file) throws IOException { - Path path = file.toPath(); + Path path = file.getCanonicalFile().toPath(); while (isSymbolicLink(path)) { Path link = readSymbolicLink(path); if (!link.isAbsolute()) { diff --git a/source/net/sourceforge/tuned/FileUtilities.java b/source/net/sourceforge/tuned/FileUtilities.java index 15cf54c5..fb25e3fa 100644 --- a/source/net/sourceforge/tuned/FileUtilities.java +++ b/source/net/sourceforge/tuned/FileUtilities.java @@ -100,6 +100,10 @@ public final class FileUtilities { public static File createRelativeSymlink(File link, File target, boolean relativize) throws IOException { if (relativize) { + // make sure we're working with the full path + link = link.getCanonicalFile(); + target = target.getCanonicalFile(); + try { target = link.getParentFile().toPath().relativize(target.toPath()).toFile(); } catch (Throwable e) {