@Override public UserPrincipal getOwner() throws IOException { checkAccess(file, true, false); try { UnixFileAttributes attrs = UnixFileAttributes.get(file, followLinks); return UnixUserPrincipals.fromUid(attrs.uid()); } catch (UnixException x) { x.rethrowAsIOException(file); return null; // keep compile happy } }
@Override public Map<String, Object> readAttributes(String[] requested) throws IOException { AttributesBuilder builder = AttributesBuilder.create(unixAttributeNames, requested); UnixFileAttributes attrs = readAttributes(); addRequestedPosixAttributes(attrs, builder); if (builder.match(MODE_NAME)) builder.add(MODE_NAME, attrs.mode()); if (builder.match(INO_NAME)) builder.add(INO_NAME, attrs.ino()); if (builder.match(DEV_NAME)) builder.add(DEV_NAME, attrs.dev()); if (builder.match(RDEV_NAME)) builder.add(RDEV_NAME, attrs.rdev()); if (builder.match(NLINK_NAME)) builder.add(NLINK_NAME, attrs.nlink()); if (builder.match(UID_NAME)) builder.add(UID_NAME, attrs.uid()); if (builder.match(GID_NAME)) builder.add(GID_NAME, attrs.gid()); if (builder.match(CTIME_NAME)) builder.add(CTIME_NAME, attrs.ctime()); return builder.unmodifiableMap(); }