How to Read specific date file Using AgeFileFilter? I declare particular date in property files. I tried to do that with
FileFilter fileFilter = new AgeFileFilter(cutoffDate, false);
It gives me Newer files
FileFilter fileFilter = new AgeFileFilter(cutoffDate, true);
And it gives me older with equal date files
But both of them not working as per my requirement then i also tried
FileFilter fileFilter = new AgeFileFilter(long cutoffDate);
But it gives me Older files with equal date files
And my requirement is to read or display only particular date file..
So how is it possible?
Any help will be appreciate..Thank you in Advance
AgeFileFilteronly filters files before or after the cut off date-time instance.Remember that the
cutOffDateparameter is the unix date-time in milliseconds Will you know the exact date and time by the millisecond and have it saved in your property file?If yes (unlikely), why don't you simply write your own
FileFilter? It is only a single method, and with Java 8 you can write it easily like this:I suspect that it is unlikely what you want though. Do you load just a date (without time) from your property file?
Then you probably want to get the date of the file from the last modified timestamp.
The following only accepts files that were modified today. Instead of
todayyou can have anyLocalDateloaded from your property file.