wicket.util.file
Class FileCleaner

java.lang.Object
  extended by wicket.util.file.FileCleaner

public class FileCleaner
extends java.lang.Object

Keeps track of files awaiting deletion, and deletes them when an associated marker object is reclaimed by the garbage collector.

Version:
$Id: FileCleaner.java 458651 2006-01-14 22:56:50Z jonl $
Author:
Noel Bergman, Martin Cooper

Constructor Summary
FileCleaner()
           
 
Method Summary
static int getTrackCount()
          Retrieve the number of files currently being tracked, and therefore awaiting deletion.
static void track(java.io.File file, java.lang.Object marker)
          Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.
static void track(java.lang.String path, java.lang.Object marker)
          Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCleaner

public FileCleaner()
Method Detail

track

public static void track(java.io.File file,
                         java.lang.Object marker)
Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.

Parameters:
file - The file to be tracked.
marker - The marker object used to track the file.

track

public static void track(java.lang.String path,
                         java.lang.Object marker)
Track the specified file, using the provided marker, deleting the file when the marker instance is garbage collected.

Parameters:
path - The full path to the file to be tracked.
marker - The marker object used to track the file.

getTrackCount

public static int getTrackCount()
Retrieve the number of files currently being tracked, and therefore awaiting deletion.

Returns:
the number of files being tracked.


Copyright © 2004-2007 Wicket developers. All Rights Reserved.