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)
Set whether to check 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)
Set the time; for users who prefer to express time in ms 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 tcmp)
Sets the type of comparison to be done on the file's last modified
date.
|
void | setWhen(TimeComparison t)
Set the comparison type. |
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 from which the scan is being performed. filename is the name of the file to check. file is a java.io.File object the selector can use.
Returns: whether the file is selected.
Parameters: includeDirs whether to check the timestamp on directories.
Parameters: dateTime a formatted date String
.
Parameters: granularity the number of milliseconds 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: tcmp The comparison to perform, an EnumeratedAttribute.
Parameters: t TimeComparison object.
Returns: a string describing this object