public class LastModifiedFileListFilter extends Object implements FileListFilter<File>
FileListFilter
implementation to filter those files which
File.lastModified()
is less than the age
in comparison
with the current time.
The resolution is done in seconds.
Constructor and Description |
---|
LastModifiedFileListFilter() |
Modifier and Type | Method and Description |
---|---|
List<File> |
filterFiles(File[] files)
Filters out files and returns the files that are left in a list, or an
empty list when a null is passed in.
|
long |
getAge() |
void |
setAge(long age)
Set the age that files have to be before being passed by this filter.
|
void |
setAge(long age,
TimeUnit unit)
Set the age that files have to be before being passed by this filter.
|
public long getAge()
public void setAge(long age)
File.lastModified()
plus age is greater than the current time, the file
is filtered. The resolution is seconds.
Defaults to 60 seconds.age
- the agepublic void setAge(long age, TimeUnit unit)
File.lastModified()
plus age is greater than the current time, the file
is filtered. The resolution is seconds.
Defaults to 60 seconds.age
- the ageunit
- the timeUnit.public List<File> filterFiles(File[] files)
FileListFilter
filterFiles
in interface FileListFilter<File>
files
- The files.