org.weborganic.ox.util
Class PeriodicCleaner

java.lang.Object
  extended by org.weborganic.ox.util.PeriodicCleaner

public final class PeriodicCleaner
extends Object

Periodically removes old packages from the temporary directory.

Version:
28 October 2013
Author:
Christophe Lauret

Field Summary
static long INITIAL_DELAY_MINUTES
          Initial delay before the first cleanup (2 minutes).
 
Method Summary
static int clean()
          Delete temporary files created by this application which are at least an hour old.
static int clean(File dir)
           
static void setDirectory(File directory)
           
static void setDownload(File directory)
           
static void start(int rate)
          Start the cleaning thread.
static void stop()
          Stops the cleaning thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_DELAY_MINUTES

public static final long INITIAL_DELAY_MINUTES
Initial delay before the first cleanup (2 minutes).

See Also:
Constant Field Values
Method Detail

start

public static void start(int rate)
Start the cleaning thread.

Parameters:
rate - the period in minutes between clean ups

stop

public static void stop()
Stops the cleaning thread.


setDirectory

public static void setDirectory(File directory)
Parameters:
directory - the directory to set

setDownload

public static void setDownload(File directory)
Parameters:
directory - the directory to set

clean

public static int clean()
Delete temporary files created by this application which are at least an hour old.

Returns:
the number of directories which have been deleted.

clean

public static int clean(File dir)