SaadDani
asked on
delete files older than a date
In java I want to delete all the files in a directory with an extension "*.xxx" an older then 5 days.
How can I do this?
How can I do this?
ASKER
this I already know to do, but how I delete aonly those file with a specified extension and older then 5 days?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if (f.lastModified < then && name.substring(name.length () - 3).equals("xxx"))
better:
if (f.lastModified < then && name.substring(name.length () - 4).equals(".xxx"))
;JOOP!
better:
if (f.lastModified < then && name.substring(name.length
;JOOP!
http://www.objects.com.au/java/qa/600134565.html
and add a check for each files date