ResourceSelector
, FileSelector
public class OwnedBySelector extends java.lang.Object implements FileSelector
Owner is defined in terms of Files.getOwner(java.nio.file.Path, java.nio.file.LinkOption...)
, this means the selector will accept
any file that exists and is owned by the given user. If the
getOwner
method throws an UnsupportedOperationException
the file in question is not included.
Constructor | Description |
---|---|
OwnedBySelector() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
isSelected(java.io.File basedir,
java.lang.String filename,
java.io.File file) |
Method that each selector will implement to create their
selection behaviour.
|
void |
setFollowSymlinks(boolean followSymlinks) |
Sets the "follow symbolic links" option.
|
void |
setOwner(java.lang.String owner) |
Sets the user name to look for.
|
isSelected
public void setOwner(java.lang.String owner)
owner
- the user namepublic void setFollowSymlinks(boolean followSymlinks)
followSymlinks
- whether or not symbolic links should be followed.public boolean isSelected(java.io.File basedir, java.lang.String filename, java.io.File file)
FileSelector
isSelected
in interface FileSelector
basedir
- A java.io.File object for the base directoryfilename
- The name of the file to checkfile
- A File object for this filename