/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

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