# HG changeset patch # User František Kučera # Date 1475414600 -7200 # Node ID 76df01fc4aa224bb9298164e207e4104dd70717a # Parent bbb9b31255be7c5e2824118547289e9e132d46ad in-fs: comment, symlinks diff -r bbb9b31255be -r 76df01fc4aa2 java/alt2xml-in-fs/src/cz/frantovo/alt2xml/in/fs/Reader.java --- a/java/alt2xml-in-fs/src/cz/frantovo/alt2xml/in/fs/Reader.java Sun Oct 02 15:22:06 2016 +0200 +++ b/java/alt2xml-in-fs/src/cz/frantovo/alt2xml/in/fs/Reader.java Sun Oct 02 15:23:20 2016 +0200 @@ -89,7 +89,7 @@ addAttribute(attributes, name, value); return attributes; } - + private Attributes singleAttribute(String name, String value) { AttributesImpl attributes = new AttributesImpl(); addAttribute(attributes, name, value); @@ -184,7 +184,7 @@ private void outputPermissions(Path path) throws IOException, SAXException { level++; - Set permissions = Files.getPosixFilePermissions(path, LinkOption.NOFOLLOW_LINKS); + Set permissions = Files.getPosixFilePermissions(path); // TODO: maybe symlinks: LinkOption.NOFOLLOW_LINKS contentHandler.indentation(level); contentHandler.startElement(null, PERMISSIONS_ELEMENT, PERMISSIONS_ELEMENT, singleAttribute("octal", getOctal(permissions))); @@ -207,15 +207,15 @@ private int getOctal(Set permissions) { int octal = 0; - + octal = octal + 100 * (permissions.contains(PosixFilePermission.OWNER_READ) ? 4 : 0); octal = octal + 100 * (permissions.contains(PosixFilePermission.OWNER_WRITE) ? 2 : 0); octal = octal + 100 * (permissions.contains(PosixFilePermission.OWNER_EXECUTE) ? 1 : 0); - + octal = octal + 10 * (permissions.contains(PosixFilePermission.GROUP_READ) ? 4 : 0); octal = octal + 10 * (permissions.contains(PosixFilePermission.GROUP_WRITE) ? 2 : 0); octal = octal + 10 * (permissions.contains(PosixFilePermission.GROUP_EXECUTE) ? 1 : 0); - + octal = octal + 1 * (permissions.contains(PosixFilePermission.OTHERS_READ) ? 4 : 0); octal = octal + 1 * (permissions.contains(PosixFilePermission.OTHERS_WRITE) ? 2 : 0); octal = octal + 1 * (permissions.contains(PosixFilePermission.OTHERS_EXECUTE) ? 1 : 0);