public class OwnedBySelector extends java.lang.Object implements FileSelector, ResourceSelector
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 UnsupportedOperattionException
the file in question is not included.
Constructor and Description |
---|
OwnedBySelector() |
Modifier and Type | Method and 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.
|
boolean |
isSelected(Resource r)
Return true if this Resource is selected.
|
void |
setOwner(java.lang.String owner)
Sets the User-Name to look for.
|
public void setOwner(java.lang.String owner)
owner
- the user namepublic 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 filenamepublic boolean isSelected(Resource r)
ResourceSelector
isSelected
in interface ResourceSelector
r
- the Resource to check.