/lib/commons-io/apidocs/org/apache/commons/io/FileCleaner.html
https://bitbucket.org/arkban/somersault · HTML · 510 lines · 437 code · 49 blank · 24 comment · 0 complexity · b90b55d37e88cf41d26ac045de904011 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.6.0_20) on Tue Sep 28 21:40:06 EDT 2010 -->
- <TITLE>
- FileCleaner (Commons IO 1.5-SNAPSHOT)
- </TITLE>
- <META NAME="date" CONTENT="2010-09-28">
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
- <SCRIPT type="text/javascript">
- function windowTitle()
- {
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="FileCleaner (Commons IO 1.5-SNAPSHOT)";
- }
- }
- </SCRIPT>
- <NOSCRIPT>
- </NOSCRIPT>
- </HEAD>
- <BODY BGCOLOR="white" onload="windowTitle();">
- <HR>
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/apache/commons/io/EndianUtils.html" title="class in org.apache.commons.io"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/apache/commons/io/FileCleaner.html" target="_top"><B>FRAMES</B></A>
- <A HREF="FileCleaner.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- org.apache.commons.io</FONT>
- <BR>
- Class FileCleaner</H2>
- <PRE>
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
- <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.io.FileCleaner</B>
- </PRE>
- <HR>
- <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io"><CODE>FileCleaningTracker</CODE></A></I>
- <P>
- <DL>
- <DT><PRE><FONT SIZE="-1"><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public class <B>FileCleaner</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
- </PRE>
- <P>
- Keeps track of files awaiting deletion, and deletes them when an associated
- marker object is reclaimed by the garbage collector.
- <p>
- This utility creates a background thread to handle file deletion.
- Each file to be deleted is registered with a handler object.
- When the handler object is garbage collected, the file is deleted.
- <p>
- In an environment with multiple class loaders (a servlet container, for
- example), you should consider stopping the background thread if it is no
- longer needed. This is done by invoking the method
- <A HREF="../../../../org/apache/commons/io/FileCleaner.html#exitWhenFinished()"><CODE>exitWhenFinished()</CODE></A>, typically in
- <A HREF="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContextListener.html?is-external=true#contextDestroyed" title="class or interface in javax.servlet"><CODE>ServletContextListener</CODE></A> or similar.
- <P>
- <P>
- <DL>
- <DT><B>Version:</B></DT>
- <DD>$Id: FileCleaner.java 723969 2008-12-06 11:00:40Z sebb $</DD>
- <DT><B>Author:</B></DT>
- <DD>Noel Bergman, Martin Cooper</DD>
- </DL>
- <HR>
- <P>
- <!-- =========== FIELD SUMMARY =========== -->
- <A NAME="field_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Field Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>(package private) static <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#theInstance">theInstance</A></B></CODE>
- <BR>
- <B>Deprecated.</B> The instance to use for the deprecated, static methods.</TD>
- </TR>
- </TABLE>
-
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <A NAME="constructor_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Constructor Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#FileCleaner()">FileCleaner</A></B>()</CODE>
- <BR>
- <B>Deprecated.</B> </TD>
- </TR>
- </TABLE>
-
- <!-- ========== METHOD SUMMARY =========== -->
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#exitWhenFinished()">exitWhenFinished</A></B>()</CODE>
- <BR>
- <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#exitWhenFinished()"><CODE>FileCleaningTracker.exitWhenFinished()</CODE></A>.</I></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A></CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#getInstance()">getInstance</A></B>()</CODE>
- <BR>
- <B>Deprecated.</B> Returns the singleton instance, which is used by the deprecated, static methods.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static int</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#getTrackCount()">getTrackCount</A></B>()</CODE>
- <BR>
- <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#getTrackCount()"><CODE>FileCleaningTracker.getTrackCount()</CODE></A>.</I></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#track(java.io.File, java.lang.Object)">track</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> file,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker)</CODE>
- <BR>
- <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.io.File, java.lang.Object)"><CODE>FileCleaningTracker.track(File, Object)</CODE></A>.</I></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#track(java.io.File, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)">track</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> file,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker,
- <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</CODE>
- <BR>
- <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.io.File, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><CODE>FileCleaningTracker.track(File, Object, FileDeleteStrategy)</CODE></A>.</I></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#track(java.lang.String, java.lang.Object)">track</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker)</CODE>
- <BR>
- <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.lang.String, java.lang.Object)"><CODE>FileCleaningTracker.track(String, Object)</CODE></A>.</I></TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#track(java.lang.String, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)">track</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker,
- <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</CODE>
- <BR>
- <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.lang.String, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><CODE>FileCleaningTracker.track(String, Object, FileDeleteStrategy)</CODE></A>.</I></TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ============ FIELD DETAIL =========== -->
- <A NAME="field_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Field Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="theInstance"><!-- --></A><H3>
- theInstance</H3>
- <PRE>
- static final <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A> <B>theInstance</B></PRE>
- <DL>
- <DD><B>Deprecated.</B> <DD>The instance to use for the deprecated, static methods.
- <P>
- <DL>
- </DL>
- </DL>
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <A NAME="constructor_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Constructor Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="FileCleaner()"><!-- --></A><H3>
- FileCleaner</H3>
- <PRE>
- public <B>FileCleaner</B>()</PRE>
- <DL>
- <DD><B>Deprecated.</B> </DL>
- <!-- ============ METHOD DETAIL ========== -->
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="track(java.io.File, java.lang.Object)"><!-- --></A><H3>
- track</H3>
- <PRE>
- <FONT SIZE="-1"><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public static void <B>track</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> file,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker)</PRE>
- <DL>
- <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.io.File, java.lang.Object)"><CODE>FileCleaningTracker.track(File, Object)</CODE></A>.</I>
- <P>
- <DD>Track the specified file, using the provided marker, deleting the file
- when the marker instance is garbage collected.
- The <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html#NORMAL"><CODE>normal</CODE></A> deletion strategy will be used.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>file</CODE> - the file to be tracked, not null<DD><CODE>marker</CODE> - the marker object used to track the file, not null
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if the file is null</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="track(java.io.File, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><!-- --></A><H3>
- track</H3>
- <PRE>
- <FONT SIZE="-1"><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public static void <B>track</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</A> file,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker,
- <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</PRE>
- <DL>
- <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.io.File, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><CODE>FileCleaningTracker.track(File, Object, FileDeleteStrategy)</CODE></A>.</I>
- <P>
- <DD>Track the specified file, using the provided marker, deleting the file
- when the marker instance is garbage collected.
- The speified deletion strategy is used.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>file</CODE> - the file to be tracked, not null<DD><CODE>marker</CODE> - the marker object used to track the file, not null<DD><CODE>deleteStrategy</CODE> - the strategy to delete the file, null means normal
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if the file is null</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="track(java.lang.String, java.lang.Object)"><!-- --></A><H3>
- track</H3>
- <PRE>
- <FONT SIZE="-1"><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public static void <B>track</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker)</PRE>
- <DL>
- <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.lang.String, java.lang.Object)"><CODE>FileCleaningTracker.track(String, Object)</CODE></A>.</I>
- <P>
- <DD>Track the specified file, using the provided marker, deleting the file
- when the marker instance is garbage collected.
- The <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html#NORMAL"><CODE>normal</CODE></A> deletion strategy will be used.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>path</CODE> - the full path to the file to be tracked, not null<DD><CODE>marker</CODE> - the marker object used to track the file, not null
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if the path is null</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="track(java.lang.String, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><!-- --></A><H3>
- track</H3>
- <PRE>
- <FONT SIZE="-1"><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public static void <B>track</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> path,
- <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> marker,
- <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</PRE>
- <DL>
- <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#track(java.lang.String, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><CODE>FileCleaningTracker.track(String, Object, FileDeleteStrategy)</CODE></A>.</I>
- <P>
- <DD>Track the specified file, using the provided marker, deleting the file
- when the marker instance is garbage collected.
- The speified deletion strategy is used.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>path</CODE> - the full path to the file to be tracked, not null<DD><CODE>marker</CODE> - the marker object used to track the file, not null<DD><CODE>deleteStrategy</CODE> - the strategy to delete the file, null means normal
- <DT><B>Throws:</B>
- <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</A></CODE> - if the path is null</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getTrackCount()"><!-- --></A><H3>
- getTrackCount</H3>
- <PRE>
- <FONT SIZE="-1"><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public static int <B>getTrackCount</B>()</PRE>
- <DL>
- <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#getTrackCount()"><CODE>FileCleaningTracker.getTrackCount()</CODE></A>.</I>
- <P>
- <DD>Retrieve the number of files currently being tracked, and therefore
- awaiting deletion.
- <P>
- <DD><DL>
- <DT><B>Returns:</B><DD>the number of files being tracked</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="exitWhenFinished()"><!-- --></A><H3>
- exitWhenFinished</H3>
- <PRE>
- <FONT SIZE="-1"><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
- </FONT>public static void <B>exitWhenFinished</B>()</PRE>
- <DL>
- <DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#exitWhenFinished()"><CODE>FileCleaningTracker.exitWhenFinished()</CODE></A>.</I>
- <P>
- <DD>Call this method to cause the file cleaner thread to terminate when
- there are no more objects being tracked for deletion.
- <p>
- In a simple environment, you don't need this method as the file cleaner
- thread will simply exit when the JVM exits. In a more complex environment,
- with multiple class loaders (such as an application server), you should be
- aware that the file cleaner thread will continue running even if the class
- loader it was started from terminates. This can consitute a memory leak.
- <p>
- For example, suppose that you have developed a web application, which
- contains the commons-io jar file in your WEB-INF/lib directory. In other
- words, the FileCleaner class is loaded through the class loader of your
- web application. If the web application is terminated, but the servlet
- container is still running, then the file cleaner thread will still exist,
- posing a memory leak.
- <p>
- This method allows the thread to be terminated. Simply call this method
- in the resource cleanup code, such as <A HREF="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContextListener.html?is-external=true#contextDestroyed" title="class or interface in javax.servlet"><CODE>ServletContextListener</CODE></A>.
- One called, no new objects can be tracked by the file cleaner.
- <P>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getInstance()"><!-- --></A><H3>
- getInstance</H3>
- <PRE>
- public static <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A> <B>getInstance</B>()</PRE>
- <DL>
- <DD><B>Deprecated.</B> <DD>Returns the singleton instance, which is used by the deprecated, static methods.
- This is mainly useful for code, which wants to support the new
- <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io"><CODE>FileCleaningTracker</CODE></A> class while maintain compatibility with the
- deprecated <A HREF="../../../../org/apache/commons/io/FileCleaner.html" title="class in org.apache.commons.io"><CODE>FileCleaner</CODE></A>.
- <P>
- <DD><DL>
- <DT><B>Returns:</B><DD>the singleton instance</DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/apache/commons/io/EndianUtils.html" title="class in org.apache.commons.io"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/apache/commons/io/FileCleaner.html" target="_top"><B>FRAMES</B></A>
- <A HREF="FileCleaner.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <HR>
- Copyright (c) 2002-2010 Apache Software Foundation
- </BODY>
- </HTML>