org.alfresco.util
Class TempFileProvider.TempFileCleanerJob
java.lang.Object
org.alfresco.util.TempFileProvider.TempFileCleanerJob
- All Implemented Interfaces:
- org.quartz.Job
- Enclosing class:
- TempFileProvider
public static class TempFileProvider.TempFileCleanerJob
- extends java.lang.Object
- implements org.quartz.Job
Cleans up all Alfresco temporary files that are older than the
given number of hours. Subdirectories are emptied as well and all directories
below the primary temporary subdirectory are removed.
The job data must include a property protectHours, which is the
number of hours to protect a temporary file from deletion since its last
modification.
Method Summary |
void |
execute(org.quartz.JobExecutionContext context)
Gets a list of all files in the temp directory
and deletes all those that are older than the given number of hours. |
static int |
removeFiles(long removeBefore)
Removes all temporary files created before the given time. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_PROTECT_HOURS
public static final java.lang.String KEY_PROTECT_HOURS
- See Also:
- Constant Field Values
TempFileProvider.TempFileCleanerJob
public TempFileProvider.TempFileCleanerJob()
execute
public void execute(org.quartz.JobExecutionContext context)
throws org.quartz.JobExecutionException
- Gets a list of all files in the
temp directory
and deletes all those that are older than the given number of hours.
- Specified by:
execute
in interface org.quartz.Job
- Throws:
org.quartz.JobExecutionException
removeFiles
public static int removeFiles(long removeBefore)
- Removes all temporary files created before the given time.
The delete will cascade down through directories as well.
- Parameters:
removeBefore
- only remove files created before this time
- Returns:
- Returns the number of files removed
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.