FileAlterationObserver.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="de">
  4. <head>
  5. <!-- Generated by javadoc -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. <title>FileAlterationObserver (Apache Commons IO 2.6 API)</title>
  8. <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
  9. <script type="text/javascript" src="../../../../../script.js"></script>
  10. </head>
  11. <body>
  12. <script type="text/javascript"><!--
  13. try {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="FileAlterationObserver (Apache Commons IO 2.6 API)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10};
  22. var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
  23. var altColor = "altColor";
  24. var rowColor = "rowColor";
  25. var tableTab = "tableTab";
  26. var activeTableTab = "activeTableTab";
  27. </script>
  28. <noscript>
  29. <div>JavaScript is disabled on your browser.</div>
  30. </noscript>
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="topNav"><a name="navbar.top">
  33. <!-- -->
  34. </a>
  35. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  36. <a name="navbar.top.firstrow">
  37. <!-- -->
  38. </a>
  39. <ul class="navList" title="Navigation">
  40. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  41. <li><a href="package-summary.html">Package</a></li>
  42. <li class="navBarCell1Rev">Class</li>
  43. <li><a href="class-use/FileAlterationObserver.html">Use</a></li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  46. <li><a href="../../../../../index-all.html">Index</a></li>
  47. <li><a href="../../../../../help-doc.html">Help</a></li>
  48. </ul>
  49. </div>
  50. <div class="subNav">
  51. <ul class="navList">
  52. <li><a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li><a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  54. </ul>
  55. <ul class="navList">
  56. <li><a href="../../../../../index.html?org/apache/commons/io/monitor/FileAlterationObserver.html" target="_top">Frames</a></li>
  57. <li><a href="FileAlterationObserver.html" target="_top">No&nbsp;Frames</a></li>
  58. </ul>
  59. <ul class="navList" id="allclasses_navbar_top">
  60. <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  61. </ul>
  62. <div>
  63. <script type="text/javascript"><!--
  64. allClassesLink = document.getElementById("allclasses_navbar_top");
  65. if(window==top) {
  66. allClassesLink.style.display = "block";
  67. }
  68. else {
  69. allClassesLink.style.display = "none";
  70. }
  71. //-->
  72. </script>
  73. </div>
  74. <div>
  75. <ul class="subNavList">
  76. <li>Summary:&nbsp;</li>
  77. <li>Nested&nbsp;|&nbsp;</li>
  78. <li>Field&nbsp;|&nbsp;</li>
  79. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  80. <li><a href="#method.summary">Method</a></li>
  81. </ul>
  82. <ul class="subNavList">
  83. <li>Detail:&nbsp;</li>
  84. <li>Field&nbsp;|&nbsp;</li>
  85. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  86. <li><a href="#method.detail">Method</a></li>
  87. </ul>
  88. </div>
  89. <a name="skip.navbar.top">
  90. <!-- -->
  91. </a></div>
  92. <!-- ========= END OF TOP NAVBAR ========= -->
  93. <!-- ======== START OF CLASS DATA ======== -->
  94. <div class="header">
  95. <div class="subTitle">org.apache.commons.io.monitor</div>
  96. <h2 title="Class FileAlterationObserver" class="title">Class FileAlterationObserver</h2>
  97. </div>
  98. <div class="contentContainer">
  99. <ul class="inheritance">
  100. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  101. <li>
  102. <ul class="inheritance">
  103. <li>org.apache.commons.io.monitor.FileAlterationObserver</li>
  104. </ul>
  105. </li>
  106. </ul>
  107. <div class="description">
  108. <ul class="blockList">
  109. <li class="blockList">
  110. <dl>
  111. <dt>All Implemented Interfaces:</dt>
  112. <dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
  113. </dl>
  114. <hr>
  115. <br>
  116. <pre>public class <span class="typeNameLabel">FileAlterationObserver</span>
  117. extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
  118. implements <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
  119. <div class="block">FileAlterationObserver represents the state of files below a root directory,
  120. checking the filesystem and notifying listeners of create, change or
  121. delete events.
  122. <p>
  123. To use this implementation:
  124. <ul>
  125. <li>Create <a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor"><code>FileAlterationListener</code></a> implementation(s) that process
  126. the file/directory create, change and delete events</li>
  127. <li>Register the listener(s) with a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationObserver</code></a> for
  128. the appropriate directory.</li>
  129. <li>Either register the observer(s) with a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationMonitor</code></a> or
  130. run manually.</li>
  131. </ul>
  132. <h2>Basic Usage</h2>
  133. Create a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationObserver</code></a> for the directory and register the listeners:
  134. <pre>
  135. File directory = new File(new File("."), "src");
  136. FileAlterationObserver observer = new FileAlterationObserver(directory);
  137. observer.addListener(...);
  138. observer.addListener(...);
  139. </pre>
  140. To manually observe a directory, initialize the observer and invoked the
  141. <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#checkAndNotify--"><code>checkAndNotify()</code></a> method as required:
  142. <pre>
  143. // initialize
  144. observer.init();
  145. ...
  146. // invoke as required
  147. observer.checkAndNotify();
  148. ...
  149. observer.checkAndNotify();
  150. ...
  151. // finished
  152. observer.finish();
  153. </pre>
  154. Alternatively, register the observer(s) with a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationMonitor</code></a>,
  155. which creates a new thread, invoking the observer at the specified interval:
  156. <pre>
  157. long interval = ...
  158. FileAlterationMonitor monitor = new FileAlterationMonitor(interval);
  159. monitor.addObserver(observer);
  160. monitor.start();
  161. ...
  162. monitor.stop();
  163. </pre>
  164. <h2>File Filters</h2>
  165. This implementation can monitor portions of the file system
  166. by using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a>s to observe only the files and/or directories
  167. that are of interest. This makes it more efficient and reduces the
  168. noise from <i>unwanted</i> file system events.
  169. <p>
  170. <a href="http://commons.apache.org/io/">Commons IO</a> has a good range of
  171. useful, ready made
  172. <a href="../filefilter/package-summary.html">File Filter</a>
  173. implementations for this purpose.
  174. <p>
  175. For example, to only observe 1) visible directories and 2) files with a ".java" suffix
  176. in a root directory called "src" you could set up a <a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationObserver</code></a> in the following
  177. way:
  178. <pre>
  179. // Create a FileFilter
  180. IOFileFilter directories = FileFilterUtils.and(
  181. FileFilterUtils.directoryFileFilter(),
  182. HiddenFileFilter.VISIBLE);
  183. IOFileFilter files = FileFilterUtils.and(
  184. FileFilterUtils.fileFileFilter(),
  185. FileFilterUtils.suffixFileFilter(".java"));
  186. IOFileFilter filter = FileFilterUtils.or(directories, files);
  187. // Create the File system observer and register File Listeners
  188. FileAlterationObserver observer = new FileAlterationObserver(new File("src"), filter);
  189. observer.addListener(...);
  190. observer.addListener(...);
  191. </pre>
  192. <h2>FileEntry</h2>
  193. <a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><code>FileEntry</code></a> represents the state of a file or directory, capturing
  194. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a> attributes at a point in time. Custom implementations of
  195. <a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><code>FileEntry</code></a> can be used to capture additional properties that the
  196. basic implementation does not support. The <a href="../../../../../org/apache/commons/io/monitor/FileEntry.html#refresh-java.io.File-"><code>FileEntry.refresh(File)</code></a>
  197. method is used to determine if a file or directory has changed since the last
  198. check and stores the current state of the <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a>'s properties.</div>
  199. <dl>
  200. <dt><span class="simpleTagLabel">Since:</span></dt>
  201. <dd>2.0</dd>
  202. <dt><span class="simpleTagLabel">Version:</span></dt>
  203. <dd>$Id$</dd>
  204. <dt><span class="seeLabel">See Also:</span></dt>
  205. <dd><a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor"><code>FileAlterationListener</code></a>,
  206. <a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><code>FileAlterationMonitor</code></a>,
  207. <a href="../../../../../serialized-form.html#org.apache.commons.io.monitor.FileAlterationObserver">Serialized Form</a></dd>
  208. </dl>
  209. </li>
  210. </ul>
  211. </div>
  212. <div class="summary">
  213. <ul class="blockList">
  214. <li class="blockList">
  215. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  216. <ul class="blockList">
  217. <li class="blockList"><a name="constructor.summary">
  218. <!-- -->
  219. </a>
  220. <h3>Constructor Summary</h3>
  221. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  222. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  223. <tr>
  224. <th class="colFirst" scope="col">Modifier</th>
  225. <th class="colLast" scope="col">Constructor and Description</th>
  226. </tr>
  227. <tr class="altColor">
  228. <td class="colFirst"><code>&nbsp;</code></td>
  229. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver-java.io.File-">FileAlterationObserver</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory)</code>
  230. <div class="block">Construct an observer for the specified directory.</div>
  231. </td>
  232. </tr>
  233. <tr class="rowColor">
  234. <td class="colFirst"><code>protected </code></td>
  235. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver-org.apache.commons.io.monitor.FileEntry-java.io.FileFilter-org.apache.commons.io.IOCase-">FileAlterationObserver</a></span>(<a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor">FileEntry</a>&nbsp;rootEntry,
  236. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
  237. <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
  238. <div class="block">Construct an observer for the specified directory, file filter and
  239. file comparator.</div>
  240. </td>
  241. </tr>
  242. <tr class="altColor">
  243. <td class="colFirst"><code>&nbsp;</code></td>
  244. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver-java.io.File-java.io.FileFilter-">FileAlterationObserver</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
  245. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</code>
  246. <div class="block">Construct an observer for the specified directory and file filter.</div>
  247. </td>
  248. </tr>
  249. <tr class="rowColor">
  250. <td class="colFirst"><code>&nbsp;</code></td>
  251. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver-java.io.File-java.io.FileFilter-org.apache.commons.io.IOCase-">FileAlterationObserver</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
  252. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
  253. <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
  254. <div class="block">Construct an observer for the specified directory, file filter and
  255. file comparator.</div>
  256. </td>
  257. </tr>
  258. <tr class="altColor">
  259. <td class="colFirst"><code>&nbsp;</code></td>
  260. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver-java.lang.String-">FileAlterationObserver</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName)</code>
  261. <div class="block">Construct an observer for the specified directory.</div>
  262. </td>
  263. </tr>
  264. <tr class="rowColor">
  265. <td class="colFirst"><code>&nbsp;</code></td>
  266. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver-java.lang.String-java.io.FileFilter-">FileAlterationObserver</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
  267. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</code>
  268. <div class="block">Construct an observer for the specified directory and file filter.</div>
  269. </td>
  270. </tr>
  271. <tr class="altColor">
  272. <td class="colFirst"><code>&nbsp;</code></td>
  273. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#FileAlterationObserver-java.lang.String-java.io.FileFilter-org.apache.commons.io.IOCase-">FileAlterationObserver</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
  274. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
  275. <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
  276. <div class="block">Construct an observer for the specified directory, file filter and
  277. file comparator.</div>
  278. </td>
  279. </tr>
  280. </table>
  281. </li>
  282. </ul>
  283. <!-- ========== METHOD SUMMARY =========== -->
  284. <ul class="blockList">
  285. <li class="blockList"><a name="method.summary">
  286. <!-- -->
  287. </a>
  288. <h3>Method Summary</h3>
  289. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  290. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  291. <tr>
  292. <th class="colFirst" scope="col">Modifier and Type</th>
  293. <th class="colLast" scope="col">Method and Description</th>
  294. </tr>
  295. <tr id="i0" class="altColor">
  296. <td class="colFirst"><code>void</code></td>
  297. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#addListener-org.apache.commons.io.monitor.FileAlterationListener-">addListener</a></span>(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</code>
  298. <div class="block">Add a file system listener.</div>
  299. </td>
  300. </tr>
  301. <tr id="i1" class="rowColor">
  302. <td class="colFirst"><code>void</code></td>
  303. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#checkAndNotify--">checkAndNotify</a></span>()</code>
  304. <div class="block">Check whether the file and its children have been created, modified or deleted.</div>
  305. </td>
  306. </tr>
  307. <tr id="i2" class="altColor">
  308. <td class="colFirst"><code>void</code></td>
  309. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#destroy--">destroy</a></span>()</code>
  310. <div class="block">Final processing.</div>
  311. </td>
  312. </tr>
  313. <tr id="i3" class="rowColor">
  314. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
  315. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#getDirectory--">getDirectory</a></span>()</code>
  316. <div class="block">Return the directory being observed.</div>
  317. </td>
  318. </tr>
  319. <tr id="i4" class="altColor">
  320. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a></code></td>
  321. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#getFileFilter--">getFileFilter</a></span>()</code>
  322. <div class="block">Return the fileFilter.</div>
  323. </td>
  324. </tr>
  325. <tr id="i5" class="rowColor">
  326. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&gt;</code></td>
  327. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#getListeners--">getListeners</a></span>()</code>
  328. <div class="block">Returns the set of registered file system listeners.</div>
  329. </td>
  330. </tr>
  331. <tr id="i6" class="altColor">
  332. <td class="colFirst"><code>void</code></td>
  333. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#initialize--">initialize</a></span>()</code>
  334. <div class="block">Initialize the observer.</div>
  335. </td>
  336. </tr>
  337. <tr id="i7" class="rowColor">
  338. <td class="colFirst"><code>void</code></td>
  339. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#removeListener-org.apache.commons.io.monitor.FileAlterationListener-">removeListener</a></span>(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</code>
  340. <div class="block">Remove a file system listener.</div>
  341. </td>
  342. </tr>
  343. <tr id="i8" class="altColor">
  344. <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  345. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/monitor/FileAlterationObserver.html#toString--">toString</a></span>()</code>
  346. <div class="block">Provide a String representation of this observer.</div>
  347. </td>
  348. </tr>
  349. </table>
  350. <ul class="blockList">
  351. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  352. <!-- -->
  353. </a>
  354. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  355. <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/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://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
  356. </ul>
  357. </li>
  358. </ul>
  359. </li>
  360. </ul>
  361. </div>
  362. <div class="details">
  363. <ul class="blockList">
  364. <li class="blockList">
  365. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  366. <ul class="blockList">
  367. <li class="blockList"><a name="constructor.detail">
  368. <!-- -->
  369. </a>
  370. <h3>Constructor Detail</h3>
  371. <a name="FileAlterationObserver-java.lang.String-">
  372. <!-- -->
  373. </a>
  374. <ul class="blockList">
  375. <li class="blockList">
  376. <h4>FileAlterationObserver</h4>
  377. <pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName)</pre>
  378. <div class="block">Construct an observer for the specified directory.</div>
  379. <dl>
  380. <dt><span class="paramLabel">Parameters:</span></dt>
  381. <dd><code>directoryName</code> - the name of the directory to observe</dd>
  382. </dl>
  383. </li>
  384. </ul>
  385. <a name="FileAlterationObserver-java.lang.String-java.io.FileFilter-">
  386. <!-- -->
  387. </a>
  388. <ul class="blockList">
  389. <li class="blockList">
  390. <h4>FileAlterationObserver</h4>
  391. <pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
  392. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</pre>
  393. <div class="block">Construct an observer for the specified directory and file filter.</div>
  394. <dl>
  395. <dt><span class="paramLabel">Parameters:</span></dt>
  396. <dd><code>directoryName</code> - the name of the directory to observe</dd>
  397. <dd><code>fileFilter</code> - The file filter or null if none</dd>
  398. </dl>
  399. </li>
  400. </ul>
  401. <a name="FileAlterationObserver-java.lang.String-java.io.FileFilter-org.apache.commons.io.IOCase-">
  402. <!-- -->
  403. </a>
  404. <ul class="blockList">
  405. <li class="blockList">
  406. <h4>FileAlterationObserver</h4>
  407. <pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;directoryName,
  408. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
  409. <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
  410. <div class="block">Construct an observer for the specified directory, file filter and
  411. file comparator.</div>
  412. <dl>
  413. <dt><span class="paramLabel">Parameters:</span></dt>
  414. <dd><code>directoryName</code> - the name of the directory to observe</dd>
  415. <dd><code>fileFilter</code> - The file filter or null if none</dd>
  416. <dd><code>caseSensitivity</code> - what case sensitivity to use comparing file names, null means system sensitive</dd>
  417. </dl>
  418. </li>
  419. </ul>
  420. <a name="FileAlterationObserver-java.io.File-">
  421. <!-- -->
  422. </a>
  423. <ul class="blockList">
  424. <li class="blockList">
  425. <h4>FileAlterationObserver</h4>
  426. <pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory)</pre>
  427. <div class="block">Construct an observer for the specified directory.</div>
  428. <dl>
  429. <dt><span class="paramLabel">Parameters:</span></dt>
  430. <dd><code>directory</code> - the directory to observe</dd>
  431. </dl>
  432. </li>
  433. </ul>
  434. <a name="FileAlterationObserver-java.io.File-java.io.FileFilter-">
  435. <!-- -->
  436. </a>
  437. <ul class="blockList">
  438. <li class="blockList">
  439. <h4>FileAlterationObserver</h4>
  440. <pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
  441. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter)</pre>
  442. <div class="block">Construct an observer for the specified directory and file filter.</div>
  443. <dl>
  444. <dt><span class="paramLabel">Parameters:</span></dt>
  445. <dd><code>directory</code> - the directory to observe</dd>
  446. <dd><code>fileFilter</code> - The file filter or null if none</dd>
  447. </dl>
  448. </li>
  449. </ul>
  450. <a name="FileAlterationObserver-java.io.File-java.io.FileFilter-org.apache.commons.io.IOCase-">
  451. <!-- -->
  452. </a>
  453. <ul class="blockList">
  454. <li class="blockList">
  455. <h4>FileAlterationObserver</h4>
  456. <pre>public&nbsp;FileAlterationObserver(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
  457. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
  458. <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
  459. <div class="block">Construct an observer for the specified directory, file filter and
  460. file comparator.</div>
  461. <dl>
  462. <dt><span class="paramLabel">Parameters:</span></dt>
  463. <dd><code>directory</code> - the directory to observe</dd>
  464. <dd><code>fileFilter</code> - The file filter or null if none</dd>
  465. <dd><code>caseSensitivity</code> - what case sensitivity to use comparing file names, null means system sensitive</dd>
  466. </dl>
  467. </li>
  468. </ul>
  469. <a name="FileAlterationObserver-org.apache.commons.io.monitor.FileEntry-java.io.FileFilter-org.apache.commons.io.IOCase-">
  470. <!-- -->
  471. </a>
  472. <ul class="blockListLast">
  473. <li class="blockList">
  474. <h4>FileAlterationObserver</h4>
  475. <pre>protected&nbsp;FileAlterationObserver(<a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor">FileEntry</a>&nbsp;rootEntry,
  476. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;fileFilter,
  477. <a href="../../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
  478. <div class="block">Construct an observer for the specified directory, file filter and
  479. file comparator.</div>
  480. <dl>
  481. <dt><span class="paramLabel">Parameters:</span></dt>
  482. <dd><code>rootEntry</code> - the root directory to observe</dd>
  483. <dd><code>fileFilter</code> - The file filter or null if none</dd>
  484. <dd><code>caseSensitivity</code> - what case sensitivity to use comparing file names, null means system sensitive</dd>
  485. </dl>
  486. </li>
  487. </ul>
  488. </li>
  489. </ul>
  490. <!-- ============ METHOD DETAIL ========== -->
  491. <ul class="blockList">
  492. <li class="blockList"><a name="method.detail">
  493. <!-- -->
  494. </a>
  495. <h3>Method Detail</h3>
  496. <a name="getDirectory--">
  497. <!-- -->
  498. </a>
  499. <ul class="blockList">
  500. <li class="blockList">
  501. <h4>getDirectory</h4>
  502. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;getDirectory()</pre>
  503. <div class="block">Return the directory being observed.</div>
  504. <dl>
  505. <dt><span class="returnLabel">Returns:</span></dt>
  506. <dd>the directory being observed</dd>
  507. </dl>
  508. </li>
  509. </ul>
  510. <a name="getFileFilter--">
  511. <!-- -->
  512. </a>
  513. <ul class="blockList">
  514. <li class="blockList">
  515. <h4>getFileFilter</h4>
  516. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;getFileFilter()</pre>
  517. <div class="block">Return the fileFilter.</div>
  518. <dl>
  519. <dt><span class="returnLabel">Returns:</span></dt>
  520. <dd>the fileFilter</dd>
  521. <dt><span class="simpleTagLabel">Since:</span></dt>
  522. <dd>2.1</dd>
  523. </dl>
  524. </li>
  525. </ul>
  526. <a name="addListener-org.apache.commons.io.monitor.FileAlterationListener-">
  527. <!-- -->
  528. </a>
  529. <ul class="blockList">
  530. <li class="blockList">
  531. <h4>addListener</h4>
  532. <pre>public&nbsp;void&nbsp;addListener(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</pre>
  533. <div class="block">Add a file system listener.</div>
  534. <dl>
  535. <dt><span class="paramLabel">Parameters:</span></dt>
  536. <dd><code>listener</code> - The file system listener</dd>
  537. </dl>
  538. </li>
  539. </ul>
  540. <a name="removeListener-org.apache.commons.io.monitor.FileAlterationListener-">
  541. <!-- -->
  542. </a>
  543. <ul class="blockList">
  544. <li class="blockList">
  545. <h4>removeListener</h4>
  546. <pre>public&nbsp;void&nbsp;removeListener(<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&nbsp;listener)</pre>
  547. <div class="block">Remove a file system listener.</div>
  548. <dl>
  549. <dt><span class="paramLabel">Parameters:</span></dt>
  550. <dd><code>listener</code> - The file system listener</dd>
  551. </dl>
  552. </li>
  553. </ul>
  554. <a name="getListeners--">
  555. <!-- -->
  556. </a>
  557. <ul class="blockList">
  558. <li class="blockList">
  559. <h4>getListeners</h4>
  560. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../../org/apache/commons/io/monitor/FileAlterationListener.html" title="interface in org.apache.commons.io.monitor">FileAlterationListener</a>&gt;&nbsp;getListeners()</pre>
  561. <div class="block">Returns the set of registered file system listeners.</div>
  562. <dl>
  563. <dt><span class="returnLabel">Returns:</span></dt>
  564. <dd>The file system listeners</dd>
  565. </dl>
  566. </li>
  567. </ul>
  568. <a name="initialize--">
  569. <!-- -->
  570. </a>
  571. <ul class="blockList">
  572. <li class="blockList">
  573. <h4>initialize</h4>
  574. <pre>public&nbsp;void&nbsp;initialize()
  575. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
  576. <div class="block">Initialize the observer.</div>
  577. <dl>
  578. <dt><span class="throwsLabel">Throws:</span></dt>
  579. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - if an error occurs</dd>
  580. </dl>
  581. </li>
  582. </ul>
  583. <a name="destroy--">
  584. <!-- -->
  585. </a>
  586. <ul class="blockList">
  587. <li class="blockList">
  588. <h4>destroy</h4>
  589. <pre>public&nbsp;void&nbsp;destroy()
  590. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
  591. <div class="block">Final processing.</div>
  592. <dl>
  593. <dt><span class="throwsLabel">Throws:</span></dt>
  594. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - if an error occurs</dd>
  595. </dl>
  596. </li>
  597. </ul>
  598. <a name="checkAndNotify--">
  599. <!-- -->
  600. </a>
  601. <ul class="blockList">
  602. <li class="blockList">
  603. <h4>checkAndNotify</h4>
  604. <pre>public&nbsp;void&nbsp;checkAndNotify()</pre>
  605. <div class="block">Check whether the file and its children have been created, modified or deleted.</div>
  606. </li>
  607. </ul>
  608. <a name="toString--">
  609. <!-- -->
  610. </a>
  611. <ul class="blockListLast">
  612. <li class="blockList">
  613. <h4>toString</h4>
  614. <pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
  615. <div class="block">Provide a String representation of this observer.</div>
  616. <dl>
  617. <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
  618. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
  619. <dt><span class="returnLabel">Returns:</span></dt>
  620. <dd>a String representation of this observer</dd>
  621. </dl>
  622. </li>
  623. </ul>
  624. </li>
  625. </ul>
  626. </li>
  627. </ul>
  628. </div>
  629. </div>
  630. <!-- ========= END OF CLASS DATA ========= -->
  631. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  632. <div class="bottomNav"><a name="navbar.bottom">
  633. <!-- -->
  634. </a>
  635. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  636. <a name="navbar.bottom.firstrow">
  637. <!-- -->
  638. </a>
  639. <ul class="navList" title="Navigation">
  640. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  641. <li><a href="package-summary.html">Package</a></li>
  642. <li class="navBarCell1Rev">Class</li>
  643. <li><a href="class-use/FileAlterationObserver.html">Use</a></li>
  644. <li><a href="package-tree.html">Tree</a></li>
  645. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  646. <li><a href="../../../../../index-all.html">Index</a></li>
  647. <li><a href="../../../../../help-doc.html">Help</a></li>
  648. </ul>
  649. </div>
  650. <div class="subNav">
  651. <ul class="navList">
  652. <li><a href="../../../../../org/apache/commons/io/monitor/FileAlterationMonitor.html" title="class in org.apache.commons.io.monitor"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  653. <li><a href="../../../../../org/apache/commons/io/monitor/FileEntry.html" title="class in org.apache.commons.io.monitor"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  654. </ul>
  655. <ul class="navList">
  656. <li><a href="../../../../../index.html?org/apache/commons/io/monitor/FileAlterationObserver.html" target="_top">Frames</a></li>
  657. <li><a href="FileAlterationObserver.html" target="_top">No&nbsp;Frames</a></li>
  658. </ul>
  659. <ul class="navList" id="allclasses_navbar_bottom">
  660. <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  661. </ul>
  662. <div>
  663. <script type="text/javascript"><!--
  664. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  665. if(window==top) {
  666. allClassesLink.style.display = "block";
  667. }
  668. else {
  669. allClassesLink.style.display = "none";
  670. }
  671. //-->
  672. </script>
  673. </div>
  674. <div>
  675. <ul class="subNavList">
  676. <li>Summary:&nbsp;</li>
  677. <li>Nested&nbsp;|&nbsp;</li>
  678. <li>Field&nbsp;|&nbsp;</li>
  679. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  680. <li><a href="#method.summary">Method</a></li>
  681. </ul>
  682. <ul class="subNavList">
  683. <li>Detail:&nbsp;</li>
  684. <li>Field&nbsp;|&nbsp;</li>
  685. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  686. <li><a href="#method.detail">Method</a></li>
  687. </ul>
  688. </div>
  689. <a name="skip.navbar.bottom">
  690. <!-- -->
  691. </a></div>
  692. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  693. <p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  694. </body>
  695. </html>