Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public FileAttributes( @Nonnull File file, @Nonnull Map<Integer, String> userCac
Path path = file.toPath();
if ( AttributeUtils.isUnix( path ) )
{
Map<String, Object> attrs = Files.readAttributes( path, "unix:*", LinkOption.NOFOLLOW_LINKS );
Map<String, Object> attrs = Files.readAttributes( path, "unix:permissions,gid,uid,isSymbolicLink,mode", LinkOption.NOFOLLOW_LINKS );
this.permissions = (Set<PosixFilePermission>) attrs.get( "permissions" );

groupId = (Integer) attrs.get( "gid" );
Expand All @@ -76,7 +76,8 @@ public FileAttributes( @Nonnull File file, @Nonnull Map<Integer, String> userCac
}
else
{
this.groupName = ( (Principal) attrs.get( "group" ) ).getName();
Object group = Files.getAttribute( path, "unix:group", LinkOption.NOFOLLOW_LINKS );
this.groupName = ( (Principal) group ).getName();
groupCache.put( groupId, this.groupName );
}
userId = (Integer) attrs.get( "uid" );
Expand All @@ -87,7 +88,8 @@ public FileAttributes( @Nonnull File file, @Nonnull Map<Integer, String> userCac
}
else
{
this.userName = ( (Principal) attrs.get( "owner" ) ).getName();
Object owner = Files.getAttribute( path, "unix:owner", LinkOption.NOFOLLOW_LINKS );
this.userName = ( (Principal) owner ).getName();
userCache.put( userId, this.userName );
}
octalMode = (Integer) attrs.get( "mode" ) & 0xfff; // Mask off top bits for compatibilty. Maybe check if we
Expand Down