public class DateSelector extends BaseExtendSelector
| Modifier and Type | Class and Description |
|---|---|
static class |
DateSelector.TimeComparisons |
| Modifier and Type | Field and Description |
|---|---|
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
|
parameters| Constructor and Description |
|---|
DateSelector()
Creates a new
DateSelector instance. |
| Modifier and Type | Method and Description |
|---|---|
long |
getMillis()
Returns the millisecond value the selector is set for.
|
boolean |
isSelected(InstallData idata,
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.
|
getParametersgetError, setError, validategetDescription, isChecked, noChildrenAllowed, setChecked, setDescription, tooManyAttributespublic static final String MILLIS_KEY
public static final String DATETIME_KEY
public static final String CHECKDIRS_KEY
public static final String GRANULARITY_KEY
public static final String WHEN_KEY
public static final String PATTERN_KEY
public String toString()
public void setMillis(long millis)
millis - the time to compare file's last modified date to,
expressed in millisecondspublic long getMillis()
throws Exception
Exceptionpublic void setDatetime(String dateTime)
dateTime - a string in MM/DD/YYYY HH:MM AM_PM formatpublic void setCheckdirs(boolean includeDirs)
includeDirs - whether to check the timestamp on directoriespublic void setGranularity(int granularity)
granularity - the number of milliconds leewaypublic void setWhen(DateSelector.TimeComparisons cmp)
cmp - The comparison to perform, an EnumeratedAttributepublic void setPattern(String pattern)
pattern - the pattern that defines the date formatpublic void setParameters(Parameter[] parameters)
setParameters in interface ParameterizablesetParameters in class BaseExtendSelectorparameters - the complete set of parameters for this selectorpublic void verifySettings()
verifySettings in class BaseSelectorpublic boolean isSelected(InstallData idata, File basedir, String filename, File file) throws Exception
isSelected in interface FileSelectorisSelected in class BaseExtendSelectorbasedir - the base directory the scan is being done fromfilename - is the name of the file to checkfile - is a java.io.File object the selector can useException - if the selector was not configured correctlyCopyright © 2001–2025. All rights reserved.