com.jfw.scheduler.util
Class CleanOldFiles

java.lang.Object
  extended by com.jfw.scheduler.ScheduleBean
      extended by com.jfw.scheduler.util.CleanOldFiles

public final class CleanOldFiles
extends ScheduleBean

Clean the old files. All the files, independently from the extension, found in a directory and not modified for a period of time will be deleted.
To configure the cleaner the following parameters must be set in the jfw.properties file:

  1. file_cleaner=true -> activate cleaner
  2. file_cleaner_paths=path1,path2,... -> the paths to check
  3. file_name=filename -> delete files containg this string
  4. file_cleaner_age_days=7 -> delete files not used for this amount of days

Also must be set the scheduled object in parameter scheduled_objects. For example, the value of the previous parameter could be:
  1. scheduled_objects=com.jfw.scheduler.util.CleanOldFiles#Daily/00:30#File cleaner


Field Summary
 
Fields inherited from class com.jfw.scheduler.ScheduleBean
className, properties
 
Constructor Summary
CleanOldFiles()
           
 
Method Summary
 void start()
          Delete old files.
 
Methods inherited from class com.jfw.scheduler.ScheduleBean
addError, getAdvance, sendEmail, setAdvance, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CleanOldFiles

public CleanOldFiles()
Method Detail

start

public void start()
           throws java.lang.Throwable
Delete old files.

Specified by:
start in class ScheduleBean
Throws:
java.lang.Throwable