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() |
LastModifiedFileListFilter(long age)
Construct a
LastModifiedFileListFilter instance with provided age. |
| 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 LastModifiedFileListFilter()
public LastModifiedFileListFilter(long age)
LastModifiedFileListFilter instance with provided age.
Defaults to 60 seconds.age - the age in seconds.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)
FileListFilterfilterFiles in interface FileListFilter<File>files - The files.