## com.crystaldecisions.report.web.viewer
Class CrystalImageCleaner

    java.lang.Object
      com.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 used 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.

#### Example:

This example creates a `CrystalImageCleaner` object that scans for image files once every minute, but only deletes files that are at least two minutes old. `

     <%!
     public void jspInit() {
        CrystalImageCleaner.start(getServletContext(), 60000, 12000);
     }
     public void jspDestroy() {
        CrystalImageCleaner.stop(getServletContext());
     }
     %>

`

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.