public class NewerThan extends LastModifiedFilter
FileFilter
accepts files based on the last modified time of the file.
As the name suggests, files are accepted based on whether or not the last modified time is newer than the specified interval. The interval either follows the ISO8601 convention for durations or is the precise number of milliseconds since the epoch.
The interval is represented by the format [+-]P[n]Y[n]M[n]DT[n]H[n]M[n]S. In these representations, the [n] is replaced by the value for each of the date and time elements that follow the [n]. Leading zeros are not required. The capital letters 'P', 'Y', 'M', 'W', 'D', 'T', 'H', 'M', and 'S' are designators for each of the date and time elements and are not replaced.
For example, P3Y6M4DT12H30M5S
represents a duration of three years, six months, four days, twelve hours, thirty
minutes, and five seconds . Date and time elements including their designator may be omitted if their value is zero, and lower
order elements may also be omitted for reduced precision. For example, "P23DT23H" and "P4Y" are both acceptable duration
representations.
To resolve ambiguity, "P1M" is a one-month duration and "PT1M" is a one-minute duration (note the time designator, T, that precedes the time value). The seconds value used may also have a decimal fraction, as in "PT0.5S" to indicate half a second."PT36H" could be used as well as "P1DT12H" for representing the same duration.
A negative period will become some date in the past; a positive or unspecified period will resolve to some time in the future.
For example -P30D
will resolve to 30 days ago, whereas P30D
will resolve to 30 days in the future.
Duration
logR
Constructor and Description |
---|
NewerThan(java.lang.String s)
Create the filefilter using an ISO8601 formatted interval.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File pathname) |
filterDate