/lib/commons-io/apidocs/org/apache/commons/io/FileCleaner.html
HTML | 510 lines | 437 code | 49 blank | 24 comment | 0 complexity | b90b55d37e88cf41d26ac045de904011 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, Apache-2.0
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.6.0_20) on Tue Sep 28 21:40:06 EDT 2010 -->
6<TITLE>
7FileCleaner (Commons IO 1.5-SNAPSHOT)
8</TITLE>
9
10<META NAME="date" CONTENT="2010-09-28">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17 if (location.href.indexOf('is-external=true') == -1) {
18 parent.document.title="FileCleaner (Commons IO 1.5-SNAPSHOT)";
19 }
20}
21</SCRIPT>
22<NOSCRIPT>
23</NOSCRIPT>
24
25</HEAD>
26
27<BODY BGCOLOR="white" onload="windowTitle();">
28<HR>
29
30
31<!-- ========= START OF TOP NAVBAR ======= -->
32<A NAME="navbar_top"><!-- --></A>
33<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35<TR>
36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37<A NAME="navbar_top_firstrow"><!-- --></A>
38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39 <TR ALIGN="center" VALIGN="top">
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
47 </TR>
48</TABLE>
49</TD>
50<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
51</EM>
52</TD>
53</TR>
54
55<TR>
56<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57 <A HREF="../../../../org/apache/commons/io/EndianUtils.html" title="class in org.apache.commons.io"><B>PREV CLASS</B></A>
58 <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io"><B>NEXT CLASS</B></A></FONT></TD>
59<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
60 <A HREF="../../../../index.html?org/apache/commons/io/FileCleaner.html" target="_top"><B>FRAMES</B></A>
61 <A HREF="FileCleaner.html" target="_top"><B>NO FRAMES</B></A>
62 <SCRIPT type="text/javascript">
63 <!--
64 if(window==top) {
65 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
66 }
67 //-->
68</SCRIPT>
69<NOSCRIPT>
70 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
71</NOSCRIPT>
72
73
74</FONT></TD>
75</TR>
76<TR>
77<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
78 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
79<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
80DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
81</TR>
82</TABLE>
83<A NAME="skip-navbar_top"></A>
84<!-- ========= END OF TOP NAVBAR ========= -->
85
86<HR>
87<!-- ======== START OF CLASS DATA ======== -->
88<H2>
89<FONT SIZE="-1">
90org.apache.commons.io</FONT>
91<BR>
92Class FileCleaner</H2>
93<PRE>
94<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>
95 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.io.FileCleaner</B>
96</PRE>
97<HR>
98<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>
99<P>
100<DL>
101<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>
102</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>
103</PRE>
104
105<P>
106Keeps track of files awaiting deletion, and deletes them when an associated
107 marker object is reclaimed by the garbage collector.
108 <p>
109 This utility creates a background thread to handle file deletion.
110 Each file to be deleted is registered with a handler object.
111 When the handler object is garbage collected, the file is deleted.
112 <p>
113 In an environment with multiple class loaders (a servlet container, for
114 example), you should consider stopping the background thread if it is no
115 longer needed. This is done by invoking the method
116 <A HREF="../../../../org/apache/commons/io/FileCleaner.html#exitWhenFinished()"><CODE>exitWhenFinished()</CODE></A>, typically in
117 <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.
118<P>
119
120<P>
121<DL>
122<DT><B>Version:</B></DT>
123 <DD>$Id: FileCleaner.java 723969 2008-12-06 11:00:40Z sebb $</DD>
124<DT><B>Author:</B></DT>
125 <DD>Noel Bergman, Martin Cooper</DD>
126</DL>
127<HR>
128
129<P>
130<!-- =========== FIELD SUMMARY =========== -->
131
132<A NAME="field_summary"><!-- --></A>
133<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
134<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
135<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
136<B>Field Summary</B></FONT></TH>
137</TR>
138<TR BGCOLOR="white" CLASS="TableRowColor">
139<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
140<CODE>(package private) static <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A></CODE></FONT></TD>
141<TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#theInstance">theInstance</A></B></CODE>
142
143<BR>
144 <B>Deprecated.</B> The instance to use for the deprecated, static methods.</TD>
145</TR>
146</TABLE>
147
148<!-- ======== CONSTRUCTOR SUMMARY ======== -->
149
150<A NAME="constructor_summary"><!-- --></A>
151<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
152<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
153<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
154<B>Constructor Summary</B></FONT></TH>
155</TR>
156<TR BGCOLOR="white" CLASS="TableRowColor">
157<TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#FileCleaner()">FileCleaner</A></B>()</CODE>
158
159<BR>
160 <B>Deprecated.</B> </TD>
161</TR>
162</TABLE>
163
164<!-- ========== METHOD SUMMARY =========== -->
165
166<A NAME="method_summary"><!-- --></A>
167<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
168<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
169<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
170<B>Method Summary</B></FONT></TH>
171</TR>
172<TR BGCOLOR="white" CLASS="TableRowColor">
173<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
174<CODE>static void</CODE></FONT></TD>
175<TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#exitWhenFinished()">exitWhenFinished</A></B>()</CODE>
176
177<BR>
178 <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#exitWhenFinished()"><CODE>FileCleaningTracker.exitWhenFinished()</CODE></A>.</I></TD>
179</TR>
180<TR BGCOLOR="white" CLASS="TableRowColor">
181<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
182<CODE>static <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A></CODE></FONT></TD>
183<TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#getInstance()">getInstance</A></B>()</CODE>
184
185<BR>
186 <B>Deprecated.</B> Returns the singleton instance, which is used by the deprecated, static methods.</TD>
187</TR>
188<TR BGCOLOR="white" CLASS="TableRowColor">
189<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
190<CODE>static int</CODE></FONT></TD>
191<TD><CODE><B><A HREF="../../../../org/apache/commons/io/FileCleaner.html#getTrackCount()">getTrackCount</A></B>()</CODE>
192
193<BR>
194 <B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#getTrackCount()"><CODE>FileCleaningTracker.getTrackCount()</CODE></A>.</I></TD>
195</TR>
196<TR BGCOLOR="white" CLASS="TableRowColor">
197<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
198<CODE>static void</CODE></FONT></TD>
199<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,
200 <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>
201
202<BR>
203 <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>
204</TR>
205<TR BGCOLOR="white" CLASS="TableRowColor">
206<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
207<CODE>static void</CODE></FONT></TD>
208<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,
209 <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,
210 <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</CODE>
211
212<BR>
213 <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>
214</TR>
215<TR BGCOLOR="white" CLASS="TableRowColor">
216<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
217<CODE>static void</CODE></FONT></TD>
218<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,
219 <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>
220
221<BR>
222 <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>
223</TR>
224<TR BGCOLOR="white" CLASS="TableRowColor">
225<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
226<CODE>static void</CODE></FONT></TD>
227<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,
228 <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,
229 <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</CODE>
230
231<BR>
232 <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>
233</TR>
234</TABLE>
235 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
236<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
237<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
238<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>
239</TR>
240<TR BGCOLOR="white" CLASS="TableRowColor">
241<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>
242</TR>
243</TABLE>
244
245<P>
246
247<!-- ============ FIELD DETAIL =========== -->
248
249<A NAME="field_detail"><!-- --></A>
250<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
251<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
252<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
253<B>Field Detail</B></FONT></TH>
254</TR>
255</TABLE>
256
257<A NAME="theInstance"><!-- --></A><H3>
258theInstance</H3>
259<PRE>
260static final <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A> <B>theInstance</B></PRE>
261<DL>
262<DD><B>Deprecated.</B> <DD>The instance to use for the deprecated, static methods.
263<P>
264<DL>
265</DL>
266</DL>
267
268<!-- ========= CONSTRUCTOR DETAIL ======== -->
269
270<A NAME="constructor_detail"><!-- --></A>
271<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
272<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
273<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
274<B>Constructor Detail</B></FONT></TH>
275</TR>
276</TABLE>
277
278<A NAME="FileCleaner()"><!-- --></A><H3>
279FileCleaner</H3>
280<PRE>
281public <B>FileCleaner</B>()</PRE>
282<DL>
283<DD><B>Deprecated.</B> </DL>
284
285<!-- ============ METHOD DETAIL ========== -->
286
287<A NAME="method_detail"><!-- --></A>
288<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
289<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
290<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
291<B>Method Detail</B></FONT></TH>
292</TR>
293</TABLE>
294
295<A NAME="track(java.io.File, java.lang.Object)"><!-- --></A><H3>
296track</H3>
297<PRE>
298<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>
299</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,
300 <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>
301<DL>
302<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>
303<P>
304<DD>Track the specified file, using the provided marker, deleting the file
305 when the marker instance is garbage collected.
306 The <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html#NORMAL"><CODE>normal</CODE></A> deletion strategy will be used.
307<P>
308<DD><DL>
309<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
310<DT><B>Throws:</B>
311<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>
312</DD>
313</DL>
314<HR>
315
316<A NAME="track(java.io.File, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><!-- --></A><H3>
317track</H3>
318<PRE>
319<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>
320</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,
321 <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,
322 <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</PRE>
323<DL>
324<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>
325<P>
326<DD>Track the specified file, using the provided marker, deleting the file
327 when the marker instance is garbage collected.
328 The speified deletion strategy is used.
329<P>
330<DD><DL>
331<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
332<DT><B>Throws:</B>
333<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>
334</DD>
335</DL>
336<HR>
337
338<A NAME="track(java.lang.String, java.lang.Object)"><!-- --></A><H3>
339track</H3>
340<PRE>
341<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>
342</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,
343 <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>
344<DL>
345<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>
346<P>
347<DD>Track the specified file, using the provided marker, deleting the file
348 when the marker instance is garbage collected.
349 The <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html#NORMAL"><CODE>normal</CODE></A> deletion strategy will be used.
350<P>
351<DD><DL>
352<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
353<DT><B>Throws:</B>
354<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>
355</DD>
356</DL>
357<HR>
358
359<A NAME="track(java.lang.String, java.lang.Object, org.apache.commons.io.FileDeleteStrategy)"><!-- --></A><H3>
360track</H3>
361<PRE>
362<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>
363</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,
364 <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,
365 <A HREF="../../../../org/apache/commons/io/FileDeleteStrategy.html" title="class in org.apache.commons.io">FileDeleteStrategy</A> deleteStrategy)</PRE>
366<DL>
367<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>
368<P>
369<DD>Track the specified file, using the provided marker, deleting the file
370 when the marker instance is garbage collected.
371 The speified deletion strategy is used.
372<P>
373<DD><DL>
374<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
375<DT><B>Throws:</B>
376<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>
377</DD>
378</DL>
379<HR>
380
381<A NAME="getTrackCount()"><!-- --></A><H3>
382getTrackCount</H3>
383<PRE>
384<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>
385</FONT>public static int <B>getTrackCount</B>()</PRE>
386<DL>
387<DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#getTrackCount()"><CODE>FileCleaningTracker.getTrackCount()</CODE></A>.</I>
388<P>
389<DD>Retrieve the number of files currently being tracked, and therefore
390 awaiting deletion.
391<P>
392<DD><DL>
393
394<DT><B>Returns:</B><DD>the number of files being tracked</DL>
395</DD>
396</DL>
397<HR>
398
399<A NAME="exitWhenFinished()"><!-- --></A><H3>
400exitWhenFinished</H3>
401<PRE>
402<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>
403</FONT>public static void <B>exitWhenFinished</B>()</PRE>
404<DL>
405<DD><B>Deprecated.</B> <I>Use <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html#exitWhenFinished()"><CODE>FileCleaningTracker.exitWhenFinished()</CODE></A>.</I>
406<P>
407<DD>Call this method to cause the file cleaner thread to terminate when
408 there are no more objects being tracked for deletion.
409 <p>
410 In a simple environment, you don't need this method as the file cleaner
411 thread will simply exit when the JVM exits. In a more complex environment,
412 with multiple class loaders (such as an application server), you should be
413 aware that the file cleaner thread will continue running even if the class
414 loader it was started from terminates. This can consitute a memory leak.
415 <p>
416 For example, suppose that you have developed a web application, which
417 contains the commons-io jar file in your WEB-INF/lib directory. In other
418 words, the FileCleaner class is loaded through the class loader of your
419 web application. If the web application is terminated, but the servlet
420 container is still running, then the file cleaner thread will still exist,
421 posing a memory leak.
422 <p>
423 This method allows the thread to be terminated. Simply call this method
424 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>.
425 One called, no new objects can be tracked by the file cleaner.
426<P>
427<DD><DL>
428</DL>
429</DD>
430</DL>
431<HR>
432
433<A NAME="getInstance()"><!-- --></A><H3>
434getInstance</H3>
435<PRE>
436public static <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io">FileCleaningTracker</A> <B>getInstance</B>()</PRE>
437<DL>
438<DD><B>Deprecated.</B> <DD>Returns the singleton instance, which is used by the deprecated, static methods.
439 This is mainly useful for code, which wants to support the new
440 <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
441 deprecated <A HREF="../../../../org/apache/commons/io/FileCleaner.html" title="class in org.apache.commons.io"><CODE>FileCleaner</CODE></A>.
442<P>
443<DD><DL>
444
445<DT><B>Returns:</B><DD>the singleton instance</DL>
446</DD>
447</DL>
448<!-- ========= END OF CLASS DATA ========= -->
449<HR>
450
451
452<!-- ======= START OF BOTTOM NAVBAR ====== -->
453<A NAME="navbar_bottom"><!-- --></A>
454<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
455<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
456<TR>
457<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
458<A NAME="navbar_bottom_firstrow"><!-- --></A>
459<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
460 <TR ALIGN="center" VALIGN="top">
461 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
462 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
463 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
464 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
465 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
466 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
467 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
468 </TR>
469</TABLE>
470</TD>
471<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
472</EM>
473</TD>
474</TR>
475
476<TR>
477<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
478 <A HREF="../../../../org/apache/commons/io/EndianUtils.html" title="class in org.apache.commons.io"><B>PREV CLASS</B></A>
479 <A HREF="../../../../org/apache/commons/io/FileCleaningTracker.html" title="class in org.apache.commons.io"><B>NEXT CLASS</B></A></FONT></TD>
480<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
481 <A HREF="../../../../index.html?org/apache/commons/io/FileCleaner.html" target="_top"><B>FRAMES</B></A>
482 <A HREF="FileCleaner.html" target="_top"><B>NO FRAMES</B></A>
483 <SCRIPT type="text/javascript">
484 <!--
485 if(window==top) {
486 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
487 }
488 //-->
489</SCRIPT>
490<NOSCRIPT>
491 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
492</NOSCRIPT>
493
494
495</FONT></TD>
496</TR>
497<TR>
498<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
499 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
500<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
501DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
502</TR>
503</TABLE>
504<A NAME="skip-navbar_bottom"></A>
505<!-- ======== END OF BOTTOM NAVBAR ======= -->
506
507<HR>
508Copyright (c) 2002-2010 Apache Software Foundation
509</BODY>
510</HTML>