com.crystaldecisions.report.web.viewer
Class CrystalImageCleaner

java.lang.Object
  extended bycom.crystaldecisions.report.web.viewer.CrystalImageCleaner

public class CrystalImageCleaner
extends java.lang.Object

This class is used to periodically scan the temporary directory to delete image files that were created by the viewer but were not subsequently deleted. The CrystalImageCleaner is provided as a means for the server-side application developer (that is, JSP developer) to easily perform this clean up. The developer can specify the interval between scans of the temporary directory and the minimum age of image files that are deleted from the directory. Each web server requires only one instance of the CrystalImageCleaner Object. Place any code that implements this class in the main JSP page.

Note: To improve security, it is recommended that the CrystalImageCleaner is used in your application. The Start and Stop methods must be correctly used to ensure that the appropriate image files are removed.


Method Summary
static void start(ServletContext context, long sleep, long age)
          Use the start method to start scanning the temporary image directory for image files.
static void stop(ServletContext context)
          Use the stop method to stop scanning the temporary directory for image files.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

start

public static void start(ServletContext context,
                         long sleep,
                         long age)
Use the start method to start scanning the temporary image directory for image files.

Note: The temporary directory is scanned for images in the interval provided in the sleep parameter until the Stop method is called.

Parameters:
context - A ServletContext object that specifies the context of the Servlet.
sleep - A long value that specifies the interval of time in milliseconds that the CrystalImageCleaner should sleep before scanning the temporary directory for images.
age - A long value that specifies the minimum age of an image file in milliseconds before it is deleted by the CrystalImageCleaner when the directory is scanned.

stop

public static void stop(ServletContext context)
Use the stop method to stop scanning the temporary directory for image files.

Parameters:
context - A ServletContext object that specifies the context of the Servlet.