org.apache.tools.ant.types.selectors
public class DateSelector extends BaseExtendSelector
Since: 1.5
| Nested Class Summary | |
|---|---|
| static class | DateSelector.TimeComparisons
Enumerated attribute with the values for time comparison.
|
| Field Summary | |
|---|---|
| static String | CHECKDIRS_KEY Key to used for parameterized custom selector |
| static String | DATETIME_KEY Key to used for parameterized custom selector |
| static String | GRANULARITY_KEY Key to used for parameterized custom selector |
| static String | MILLIS_KEY Key to used for parameterized custom selector |
| static String | PATTERN_KEY Key to used for parameterized custom selector |
| static String | WHEN_KEY Key to used for parameterized custom selector |
| Constructor Summary | |
|---|---|
| DateSelector()
Creates a new DateSelector instance.
| |
| Method Summary | |
|---|---|
| long | getMillis()
Returns the millisecond value the selector is set for. |
| boolean | isSelected(File basedir, String filename, File file)
The heart of the matter. |
| void | setCheckdirs(boolean includeDirs)
Should we be checking dates on directories?
|
| void | setDatetime(String dateTime)
Sets the date. |
| void | setGranularity(int granularity)
Sets the number of milliseconds leeway we will give before we consider
a file not to have matched a date. |
| void | setMillis(long millis)
For users that prefer to express time in milliseconds since 1970
|
| void | setParameters(Parameter[] parameters)
When using this as a custom selector, this method will be called.
|
| void | setPattern(String pattern)
Sets the pattern to be used for the SimpleDateFormat
|
| void | setWhen(DateSelector.TimeComparisons cmp)
Sets the type of comparison to be done on the file's last modified
date.
|
| String | toString() |
| void | verifySettings()
This is a consistency check to ensure the selector's required
values have been set. |
DateSelector instance.
Returns: the millisecond value
Parameters: basedir the base directory the scan is being done from filename is the name of the file to check file is a java.io.File object the selector can use
Returns: whether the file should be selected or not
Parameters: includeDirs whether to check the timestamp on directories
Parameters: dateTime a string in MM/DD/YYYY HH:MM AM_PM format
Parameters: granularity the number of milliconds leeway
Parameters: millis the time to compare file's last modified date to, expressed in milliseconds
Parameters: parameters the complete set of parameters for this selector
Parameters: pattern the pattern that defines the date format
Parameters: cmp The comparison to perform, an EnumeratedAttribute
Returns: a string describing this object