/** * Return true if this user has execute access to the file/directory represented by the specified FileSystemEntry object. * * @param entry - the FileSystemEntry representing the file or directory * @return true if this use has execute access */ public boolean canExecute(FileSystemEntry entry) { Permissions permissions = entry.getPermissions(); if (permissions == null) { return true; } if (equalOrBothNull(username, entry.getOwner())) { return permissions.canUserExecute(); } if (groups != null && groups.contains(entry.getGroup())) { return permissions.canGroupExecute(); } return permissions.canWorldExecute(); }
/** * Return true if this user has read access to the file/directory represented by the specified FileSystemEntry object. * * @param entry - the FileSystemEntry representing the file or directory * @return true if this use has read access */ public boolean canRead(FileSystemEntry entry) { Permissions permissions = entry.getPermissions(); if (permissions == null) { return true; } if (equalOrBothNull(username, entry.getOwner())) { return permissions.canUserRead(); } if (groups != null && groups.contains(entry.getGroup())) { return permissions.canGroupRead(); } return permissions.canWorldRead(); }
/** * Return true if this user has write access to the file/directory represented by the specified FileSystemEntry object. * * @param entry - the FileSystemEntry representing the file or directory * @return true if this use has write access */ public boolean canWrite(FileSystemEntry entry) { Permissions permissions = entry.getPermissions(); if (permissions == null) { return true; } if (equalOrBothNull(username, entry.getOwner())) { return permissions.canUserWrite(); } if (groups != null && groups.contains(entry.getGroup())) { return permissions.canGroupWrite(); } return permissions.canWorldWrite(); }