* fix for relative symlinks

This commit is contained in:
Reinhard Pointner 2014-01-08 19:29:20 +00:00
parent d63fca6787
commit 0287eac77d
1 changed files with 5 additions and 1 deletions

View File

@ -21,7 +21,11 @@ public class MetaAttributeView extends AbstractMap<String, String> {
public MetaAttributeView(File file) throws IOException { public MetaAttributeView(File file) throws IOException {
Path path = file.toPath(); Path path = file.toPath();
while (isSymbolicLink(path)) { while (isSymbolicLink(path)) {
path = readSymbolicLink(path); Path link = readSymbolicLink(path);
if (!link.isAbsolute()) {
link = path.getParent().resolve(link);
}
path = link;
} }
attributeView = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class); attributeView = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class);