org.apache.tools.ant.types.selectors

## Class OwnedBySelector

- java.lang.Object
- - org.apache.tools.ant.types.selectors.OwnedBySelector

All Implemented Interfaces:
  ResourceSelector, FileSelector

    public class OwnedBySelector
    extends java.lang.Object
    implements FileSelector, ResourceSelector

A selector that selects files based on their owner.

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.

Since:
  Ant 1.10.0

### Constructor Summary

Constructors
Constructor and Description
`OwnedBySelector()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OwnedBySelector

    public OwnedBySelector()

### Method Detail

#### setOwner

    public void setOwner(java.lang.String owner)

Sets the User-Name to look for.

Parameters:
  `owner` - the user name

#### isSelected

    public boolean isSelected(java.io.File basedir,
                              java.lang.String filename,
                              java.io.File file)

Description copied from interface: `FileSelector`
Method that each selector will implement to create their selection behaviour. If there is a problem with the setup of a selector, it can throw a BuildException to indicate the problem.

Specified by:
  `isSelected` in interface `FileSelector`
Parameters:
  `basedir` - A java.io.File object for the base directory
  `filename` - The name of the file to check
  `file` - A File object for this filename
Returns:
  whether the file should be selected or not

#### isSelected

    public boolean isSelected(Resource r)

Description copied from interface: `ResourceSelector`
Return true if this Resource is selected.

Specified by:
  `isSelected` in interface `ResourceSelector`
Parameters:
  `r` - the Resource to check.
Returns:
  whether the Resource was selected.