1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-25 17:28:51 -05:00

* just in case fixy

This commit is contained in:
Reinhard Pointner 2014-01-08 20:03:22 +00:00
parent 0287eac77d
commit 9ed32437cd
2 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,7 @@ public class MetaAttributeView extends AbstractMap<String, String> {
private final Charset encoding; private final Charset encoding;
public MetaAttributeView(File file) throws IOException { public MetaAttributeView(File file) throws IOException {
Path path = file.toPath(); Path path = file.getCanonicalFile().toPath();
while (isSymbolicLink(path)) { while (isSymbolicLink(path)) {
Path link = readSymbolicLink(path); Path link = readSymbolicLink(path);
if (!link.isAbsolute()) { if (!link.isAbsolute()) {

View File

@ -100,6 +100,10 @@ public final class FileUtilities {
public static File createRelativeSymlink(File link, File target, boolean relativize) throws IOException { public static File createRelativeSymlink(File link, File target, boolean relativize) throws IOException {
if (relativize) { if (relativize) {
// make sure we're working with the full path
link = link.getCanonicalFile();
target = target.getCanonicalFile();
try { try {
target = link.getParentFile().toPath().relativize(target.toPath()).toFile(); target = link.getParentFile().toPath().relativize(target.toPath()).toFile();
} catch (Throwable e) { } catch (Throwable e) {