コード例 #1
0
 @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();
 }
コード例 #2
0
 /**
  * Invoked by readAttributes or sub-classes to add all matching posix attributes to the builder
  */
 final void addRequestedPosixAttributes(PosixFileAttributes attrs, AttributesBuilder builder) {
   addRequestedBasicAttributes(attrs, builder);
   if (builder.match(PERMISSIONS_NAME)) builder.add(PERMISSIONS_NAME, attrs.permissions());
   if (builder.match(OWNER_NAME)) builder.add(OWNER_NAME, attrs.owner());
   if (builder.match(GROUP_NAME)) builder.add(GROUP_NAME, attrs.group());
 }