Tailer.html 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  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>Tailer (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="Tailer (Apache Commons IO 2.6 API)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10};
  22. var tabs = {65535:["t0","All Methods"],1:["t1","Static 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/Tailer.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/input/TaggedInputStream.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li><a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input"><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/input/Tailer.html" target="_top">Frames</a></li>
  57. <li><a href="Tailer.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.input</div>
  96. <h2 title="Class Tailer" class="title">Class Tailer</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.input.Tailer</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/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a></dd>
  113. </dl>
  114. <hr>
  115. <br>
  116. <pre>public class <span class="typeNameLabel">Tailer</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/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a></pre>
  119. <div class="block">Simple implementation of the unix "tail -f" functionality.
  120. <h2>1. Create a TailerListener implementation</h2>
  121. <p>
  122. First you need to create a <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input"><code>TailerListener</code></a> implementation
  123. (<a href="../../../../../org/apache/commons/io/input/TailerListenerAdapter.html" title="class in org.apache.commons.io.input"><code>TailerListenerAdapter</code></a> is provided for convenience so that you don't have to
  124. implement every method).
  125. </p>
  126. <p>For example:</p>
  127. <pre>
  128. public class MyTailerListener extends TailerListenerAdapter {
  129. public void handle(String line) {
  130. System.out.println(line);
  131. }
  132. }</pre>
  133. <h2>2. Using a Tailer</h2>
  134. <p>
  135. You can create and use a Tailer in one of three ways:
  136. </p>
  137. <ul>
  138. <li>Using one of the static helper methods:
  139. <ul>
  140. <li><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-"><code>create(File, TailerListener)</code></a></li>
  141. <li><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-long-"><code>create(File, TailerListener, long)</code></a></li>
  142. <li><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-"><code>create(File, TailerListener, long, boolean)</code></a></li>
  143. </ul>
  144. </li>
  145. <li>Using an <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent"><code>Executor</code></a></li>
  146. <li>Using an <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html?is-external=true" title="class or interface in java.lang"><code>Thread</code></a></li>
  147. </ul>
  148. <p>
  149. An example of each of these is shown below.
  150. </p>
  151. <h3>2.1 Using the static helper method</h3>
  152. <pre>
  153. TailerListener listener = new MyTailerListener();
  154. Tailer tailer = Tailer.create(file, listener, delay);</pre>
  155. <h3>2.2 Using an Executor</h3>
  156. <pre>
  157. TailerListener listener = new MyTailerListener();
  158. Tailer tailer = new Tailer(file, listener, delay);
  159. // stupid executor impl. for demo purposes
  160. Executor executor = new Executor() {
  161. public void execute(Runnable command) {
  162. command.run();
  163. }
  164. };
  165. executor.execute(tailer);
  166. </pre>
  167. <h3>2.3 Using a Thread</h3>
  168. <pre>
  169. TailerListener listener = new MyTailerListener();
  170. Tailer tailer = new Tailer(file, listener, delay);
  171. Thread thread = new Thread(tailer);
  172. thread.setDaemon(true); // optional
  173. thread.start();</pre>
  174. <h2>3. Stopping a Tailer</h2>
  175. <p>Remember to stop the tailer when you have done with it:</p>
  176. <pre>
  177. tailer.stop();
  178. </pre>
  179. <h2>4. Interrupting a Tailer</h2>
  180. <p>You can interrupt the thread a tailer is running on by calling <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html?is-external=true#interrupt--" title="class or interface in java.lang"><code>Thread.interrupt()</code></a>.</p>
  181. <pre>
  182. thread.interrupt();
  183. </pre>
  184. <p>If you interrupt a tailer, the tailer listener is called with the <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang"><code>InterruptedException</code></a>.</p>
  185. <p>The file is read using the default charset; this can be overridden if necessary</p></div>
  186. <dl>
  187. <dt><span class="simpleTagLabel">Since:</span></dt>
  188. <dd>2.0, 2.5 Updated behavior and documentation for <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html?is-external=true#interrupt--" title="class or interface in java.lang"><code>Thread.interrupt()</code></a></dd>
  189. <dt><span class="simpleTagLabel">Version:</span></dt>
  190. <dd>$Id$</dd>
  191. <dt><span class="seeLabel">See Also:</span></dt>
  192. <dd><a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input"><code>TailerListener</code></a>,
  193. <a href="../../../../../org/apache/commons/io/input/TailerListenerAdapter.html" title="class in org.apache.commons.io.input"><code>TailerListenerAdapter</code></a></dd>
  194. </dl>
  195. </li>
  196. </ul>
  197. </div>
  198. <div class="summary">
  199. <ul class="blockList">
  200. <li class="blockList">
  201. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  202. <ul class="blockList">
  203. <li class="blockList"><a name="constructor.summary">
  204. <!-- -->
  205. </a>
  206. <h3>Constructor Summary</h3>
  207. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  208. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  209. <tr>
  210. <th class="colOne" scope="col">Constructor and Description</th>
  211. </tr>
  212. <tr class="altColor">
  213. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#Tailer-java.io.File-java.nio.charset.Charset-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">Tailer</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;file,
  214. <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cset,
  215. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  216. long&nbsp;delayMillis,
  217. boolean&nbsp;end,
  218. boolean&nbsp;reOpen,
  219. int&nbsp;bufSize)</code>
  220. <div class="block">Creates a Tailer for the given file, with a specified buffer size.</div>
  221. </td>
  222. </tr>
  223. <tr class="rowColor">
  224. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#Tailer-java.io.File-org.apache.commons.io.input.TailerListener-">Tailer</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;file,
  225. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener)</code>
  226. <div class="block">Creates a Tailer for the given file, starting from the beginning, with the default delay of 1.0s.</div>
  227. </td>
  228. </tr>
  229. <tr class="altColor">
  230. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-">Tailer</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;file,
  231. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  232. long&nbsp;delayMillis)</code>
  233. <div class="block">Creates a Tailer for the given file, starting from the beginning.</div>
  234. </td>
  235. </tr>
  236. <tr class="rowColor">
  237. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-">Tailer</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;file,
  238. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  239. long&nbsp;delayMillis,
  240. boolean&nbsp;end)</code>
  241. <div class="block">Creates a Tailer for the given file, with a delay other than the default 1.0s.</div>
  242. </td>
  243. </tr>
  244. <tr class="altColor">
  245. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-">Tailer</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;file,
  246. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  247. long&nbsp;delayMillis,
  248. boolean&nbsp;end,
  249. boolean&nbsp;reOpen)</code>
  250. <div class="block">Creates a Tailer for the given file, with a delay other than the default 1.0s.</div>
  251. </td>
  252. </tr>
  253. <tr class="rowColor">
  254. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">Tailer</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;file,
  255. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  256. long&nbsp;delayMillis,
  257. boolean&nbsp;end,
  258. boolean&nbsp;reOpen,
  259. int&nbsp;bufSize)</code>
  260. <div class="block">Creates a Tailer for the given file, with a specified buffer size.</div>
  261. </td>
  262. </tr>
  263. <tr class="altColor">
  264. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-int-">Tailer</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;file,
  265. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  266. long&nbsp;delayMillis,
  267. boolean&nbsp;end,
  268. int&nbsp;bufSize)</code>
  269. <div class="block">Creates a Tailer for the given file, with a specified buffer size.</div>
  270. </td>
  271. </tr>
  272. </table>
  273. </li>
  274. </ul>
  275. <!-- ========== METHOD SUMMARY =========== -->
  276. <ul class="blockList">
  277. <li class="blockList"><a name="method.summary">
  278. <!-- -->
  279. </a>
  280. <h3>Method Summary</h3>
  281. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  282. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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>
  283. <tr>
  284. <th class="colFirst" scope="col">Modifier and Type</th>
  285. <th class="colLast" scope="col">Method and Description</th>
  286. </tr>
  287. <tr id="i0" class="altColor">
  288. <td class="colFirst"><code>static <a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a></code></td>
  289. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-java.nio.charset.Charset-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">create</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;file,
  290. <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;charset,
  291. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  292. long&nbsp;delayMillis,
  293. boolean&nbsp;end,
  294. boolean&nbsp;reOpen,
  295. int&nbsp;bufSize)</code>
  296. <div class="block">Creates and starts a Tailer for the given file.</div>
  297. </td>
  298. </tr>
  299. <tr id="i1" class="rowColor">
  300. <td class="colFirst"><code>static <a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a></code></td>
  301. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-">create</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;file,
  302. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener)</code>
  303. <div class="block">Creates and starts a Tailer for the given file, starting at the beginning of the file
  304. with the default delay of 1.0s</div>
  305. </td>
  306. </tr>
  307. <tr id="i2" class="altColor">
  308. <td class="colFirst"><code>static <a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a></code></td>
  309. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-long-">create</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;file,
  310. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  311. long&nbsp;delayMillis)</code>
  312. <div class="block">Creates and starts a Tailer for the given file, starting at the beginning of the file</div>
  313. </td>
  314. </tr>
  315. <tr id="i3" class="rowColor">
  316. <td class="colFirst"><code>static <a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a></code></td>
  317. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-">create</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;file,
  318. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  319. long&nbsp;delayMillis,
  320. boolean&nbsp;end)</code>
  321. <div class="block">Creates and starts a Tailer for the given file with default buffer size.</div>
  322. </td>
  323. </tr>
  324. <tr id="i4" class="altColor">
  325. <td class="colFirst"><code>static <a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a></code></td>
  326. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-">create</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;file,
  327. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  328. long&nbsp;delayMillis,
  329. boolean&nbsp;end,
  330. boolean&nbsp;reOpen)</code>
  331. <div class="block">Creates and starts a Tailer for the given file with default buffer size.</div>
  332. </td>
  333. </tr>
  334. <tr id="i5" class="rowColor">
  335. <td class="colFirst"><code>static <a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a></code></td>
  336. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">create</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;file,
  337. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  338. long&nbsp;delayMillis,
  339. boolean&nbsp;end,
  340. boolean&nbsp;reOpen,
  341. int&nbsp;bufSize)</code>
  342. <div class="block">Creates and starts a Tailer for the given file.</div>
  343. </td>
  344. </tr>
  345. <tr id="i6" class="altColor">
  346. <td class="colFirst"><code>static <a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a></code></td>
  347. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-int-">create</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;file,
  348. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  349. long&nbsp;delayMillis,
  350. boolean&nbsp;end,
  351. int&nbsp;bufSize)</code>
  352. <div class="block">Creates and starts a Tailer for the given file.</div>
  353. </td>
  354. </tr>
  355. <tr id="i7" class="rowColor">
  356. <td class="colFirst"><code>long</code></td>
  357. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#getDelay--">getDelay</a></span>()</code>
  358. <div class="block">Return the delay in milliseconds.</div>
  359. </td>
  360. </tr>
  361. <tr id="i8" class="altColor">
  362. <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>
  363. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#getFile--">getFile</a></span>()</code>
  364. <div class="block">Return the file.</div>
  365. </td>
  366. </tr>
  367. <tr id="i9" class="rowColor">
  368. <td class="colFirst"><code>protected boolean</code></td>
  369. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#getRun--">getRun</a></span>()</code>
  370. <div class="block">Gets whether to keep on running.</div>
  371. </td>
  372. </tr>
  373. <tr id="i10" class="altColor">
  374. <td class="colFirst"><code>void</code></td>
  375. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#run--">run</a></span>()</code>
  376. <div class="block">Follows changes in the file, calling the TailerListener's handle method for each new line.</div>
  377. </td>
  378. </tr>
  379. <tr id="i11" class="rowColor">
  380. <td class="colFirst"><code>void</code></td>
  381. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/io/input/Tailer.html#stop--">stop</a></span>()</code>
  382. <div class="block">Allows the tailer to complete its current loop and return.</div>
  383. </td>
  384. </tr>
  385. </table>
  386. <ul class="blockList">
  387. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  388. <!-- -->
  389. </a>
  390. <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>
  391. <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#toString--" title="class or interface in java.lang">toString</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>
  392. </ul>
  393. </li>
  394. </ul>
  395. </li>
  396. </ul>
  397. </div>
  398. <div class="details">
  399. <ul class="blockList">
  400. <li class="blockList">
  401. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  402. <ul class="blockList">
  403. <li class="blockList"><a name="constructor.detail">
  404. <!-- -->
  405. </a>
  406. <h3>Constructor Detail</h3>
  407. <a name="Tailer-java.io.File-org.apache.commons.io.input.TailerListener-">
  408. <!-- -->
  409. </a>
  410. <ul class="blockList">
  411. <li class="blockList">
  412. <h4>Tailer</h4>
  413. <pre>public&nbsp;Tailer(<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;file,
  414. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener)</pre>
  415. <div class="block">Creates a Tailer for the given file, starting from the beginning, with the default delay of 1.0s.</div>
  416. <dl>
  417. <dt><span class="paramLabel">Parameters:</span></dt>
  418. <dd><code>file</code> - The file to follow.</dd>
  419. <dd><code>listener</code> - the TailerListener to use.</dd>
  420. </dl>
  421. </li>
  422. </ul>
  423. <a name="Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-">
  424. <!-- -->
  425. </a>
  426. <ul class="blockList">
  427. <li class="blockList">
  428. <h4>Tailer</h4>
  429. <pre>public&nbsp;Tailer(<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;file,
  430. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  431. long&nbsp;delayMillis)</pre>
  432. <div class="block">Creates a Tailer for the given file, starting from the beginning.</div>
  433. <dl>
  434. <dt><span class="paramLabel">Parameters:</span></dt>
  435. <dd><code>file</code> - the file to follow.</dd>
  436. <dd><code>listener</code> - the TailerListener to use.</dd>
  437. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  438. </dl>
  439. </li>
  440. </ul>
  441. <a name="Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-">
  442. <!-- -->
  443. </a>
  444. <ul class="blockList">
  445. <li class="blockList">
  446. <h4>Tailer</h4>
  447. <pre>public&nbsp;Tailer(<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;file,
  448. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  449. long&nbsp;delayMillis,
  450. boolean&nbsp;end)</pre>
  451. <div class="block">Creates a Tailer for the given file, with a delay other than the default 1.0s.</div>
  452. <dl>
  453. <dt><span class="paramLabel">Parameters:</span></dt>
  454. <dd><code>file</code> - the file to follow.</dd>
  455. <dd><code>listener</code> - the TailerListener to use.</dd>
  456. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  457. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  458. </dl>
  459. </li>
  460. </ul>
  461. <a name="Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-">
  462. <!-- -->
  463. </a>
  464. <ul class="blockList">
  465. <li class="blockList">
  466. <h4>Tailer</h4>
  467. <pre>public&nbsp;Tailer(<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;file,
  468. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  469. long&nbsp;delayMillis,
  470. boolean&nbsp;end,
  471. boolean&nbsp;reOpen)</pre>
  472. <div class="block">Creates a Tailer for the given file, with a delay other than the default 1.0s.</div>
  473. <dl>
  474. <dt><span class="paramLabel">Parameters:</span></dt>
  475. <dd><code>file</code> - the file to follow.</dd>
  476. <dd><code>listener</code> - the TailerListener to use.</dd>
  477. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  478. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  479. <dd><code>reOpen</code> - if true, close and reopen the file between reading chunks</dd>
  480. </dl>
  481. </li>
  482. </ul>
  483. <a name="Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-int-">
  484. <!-- -->
  485. </a>
  486. <ul class="blockList">
  487. <li class="blockList">
  488. <h4>Tailer</h4>
  489. <pre>public&nbsp;Tailer(<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;file,
  490. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  491. long&nbsp;delayMillis,
  492. boolean&nbsp;end,
  493. int&nbsp;bufSize)</pre>
  494. <div class="block">Creates a Tailer for the given file, with a specified buffer size.</div>
  495. <dl>
  496. <dt><span class="paramLabel">Parameters:</span></dt>
  497. <dd><code>file</code> - the file to follow.</dd>
  498. <dd><code>listener</code> - the TailerListener to use.</dd>
  499. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  500. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  501. <dd><code>bufSize</code> - Buffer size</dd>
  502. </dl>
  503. </li>
  504. </ul>
  505. <a name="Tailer-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">
  506. <!-- -->
  507. </a>
  508. <ul class="blockList">
  509. <li class="blockList">
  510. <h4>Tailer</h4>
  511. <pre>public&nbsp;Tailer(<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;file,
  512. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  513. long&nbsp;delayMillis,
  514. boolean&nbsp;end,
  515. boolean&nbsp;reOpen,
  516. int&nbsp;bufSize)</pre>
  517. <div class="block">Creates a Tailer for the given file, with a specified buffer size.</div>
  518. <dl>
  519. <dt><span class="paramLabel">Parameters:</span></dt>
  520. <dd><code>file</code> - the file to follow.</dd>
  521. <dd><code>listener</code> - the TailerListener to use.</dd>
  522. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  523. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  524. <dd><code>reOpen</code> - if true, close and reopen the file between reading chunks</dd>
  525. <dd><code>bufSize</code> - Buffer size</dd>
  526. </dl>
  527. </li>
  528. </ul>
  529. <a name="Tailer-java.io.File-java.nio.charset.Charset-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">
  530. <!-- -->
  531. </a>
  532. <ul class="blockListLast">
  533. <li class="blockList">
  534. <h4>Tailer</h4>
  535. <pre>public&nbsp;Tailer(<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;file,
  536. <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cset,
  537. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  538. long&nbsp;delayMillis,
  539. boolean&nbsp;end,
  540. boolean&nbsp;reOpen,
  541. int&nbsp;bufSize)</pre>
  542. <div class="block">Creates a Tailer for the given file, with a specified buffer size.</div>
  543. <dl>
  544. <dt><span class="paramLabel">Parameters:</span></dt>
  545. <dd><code>file</code> - the file to follow.</dd>
  546. <dd><code>cset</code> - the Charset to be used for reading the file</dd>
  547. <dd><code>listener</code> - the TailerListener to use.</dd>
  548. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  549. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  550. <dd><code>reOpen</code> - if true, close and reopen the file between reading chunks</dd>
  551. <dd><code>bufSize</code> - Buffer size</dd>
  552. </dl>
  553. </li>
  554. </ul>
  555. </li>
  556. </ul>
  557. <!-- ============ METHOD DETAIL ========== -->
  558. <ul class="blockList">
  559. <li class="blockList"><a name="method.detail">
  560. <!-- -->
  561. </a>
  562. <h3>Method Detail</h3>
  563. <a name="create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-int-">
  564. <!-- -->
  565. </a>
  566. <ul class="blockList">
  567. <li class="blockList">
  568. <h4>create</h4>
  569. <pre>public static&nbsp;<a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a>&nbsp;create(<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;file,
  570. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  571. long&nbsp;delayMillis,
  572. boolean&nbsp;end,
  573. int&nbsp;bufSize)</pre>
  574. <div class="block">Creates and starts a Tailer for the given file.</div>
  575. <dl>
  576. <dt><span class="paramLabel">Parameters:</span></dt>
  577. <dd><code>file</code> - the file to follow.</dd>
  578. <dd><code>listener</code> - the TailerListener to use.</dd>
  579. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  580. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  581. <dd><code>bufSize</code> - buffer size.</dd>
  582. <dt><span class="returnLabel">Returns:</span></dt>
  583. <dd>The new tailer</dd>
  584. </dl>
  585. </li>
  586. </ul>
  587. <a name="create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">
  588. <!-- -->
  589. </a>
  590. <ul class="blockList">
  591. <li class="blockList">
  592. <h4>create</h4>
  593. <pre>public static&nbsp;<a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a>&nbsp;create(<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;file,
  594. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  595. long&nbsp;delayMillis,
  596. boolean&nbsp;end,
  597. boolean&nbsp;reOpen,
  598. int&nbsp;bufSize)</pre>
  599. <div class="block">Creates and starts a Tailer for the given file.</div>
  600. <dl>
  601. <dt><span class="paramLabel">Parameters:</span></dt>
  602. <dd><code>file</code> - the file to follow.</dd>
  603. <dd><code>listener</code> - the TailerListener to use.</dd>
  604. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  605. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  606. <dd><code>reOpen</code> - whether to close/reopen the file between chunks</dd>
  607. <dd><code>bufSize</code> - buffer size.</dd>
  608. <dt><span class="returnLabel">Returns:</span></dt>
  609. <dd>The new tailer</dd>
  610. </dl>
  611. </li>
  612. </ul>
  613. <a name="create-java.io.File-java.nio.charset.Charset-org.apache.commons.io.input.TailerListener-long-boolean-boolean-int-">
  614. <!-- -->
  615. </a>
  616. <ul class="blockList">
  617. <li class="blockList">
  618. <h4>create</h4>
  619. <pre>public static&nbsp;<a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a>&nbsp;create(<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;file,
  620. <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;charset,
  621. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  622. long&nbsp;delayMillis,
  623. boolean&nbsp;end,
  624. boolean&nbsp;reOpen,
  625. int&nbsp;bufSize)</pre>
  626. <div class="block">Creates and starts a Tailer for the given file.</div>
  627. <dl>
  628. <dt><span class="paramLabel">Parameters:</span></dt>
  629. <dd><code>file</code> - the file to follow.</dd>
  630. <dd><code>charset</code> - the character set to use for reading the file</dd>
  631. <dd><code>listener</code> - the TailerListener to use.</dd>
  632. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  633. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  634. <dd><code>reOpen</code> - whether to close/reopen the file between chunks</dd>
  635. <dd><code>bufSize</code> - buffer size.</dd>
  636. <dt><span class="returnLabel">Returns:</span></dt>
  637. <dd>The new tailer</dd>
  638. </dl>
  639. </li>
  640. </ul>
  641. <a name="create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-">
  642. <!-- -->
  643. </a>
  644. <ul class="blockList">
  645. <li class="blockList">
  646. <h4>create</h4>
  647. <pre>public static&nbsp;<a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a>&nbsp;create(<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;file,
  648. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  649. long&nbsp;delayMillis,
  650. boolean&nbsp;end)</pre>
  651. <div class="block">Creates and starts a Tailer for the given file with default buffer size.</div>
  652. <dl>
  653. <dt><span class="paramLabel">Parameters:</span></dt>
  654. <dd><code>file</code> - the file to follow.</dd>
  655. <dd><code>listener</code> - the TailerListener to use.</dd>
  656. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  657. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  658. <dt><span class="returnLabel">Returns:</span></dt>
  659. <dd>The new tailer</dd>
  660. </dl>
  661. </li>
  662. </ul>
  663. <a name="create-java.io.File-org.apache.commons.io.input.TailerListener-long-boolean-boolean-">
  664. <!-- -->
  665. </a>
  666. <ul class="blockList">
  667. <li class="blockList">
  668. <h4>create</h4>
  669. <pre>public static&nbsp;<a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a>&nbsp;create(<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;file,
  670. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  671. long&nbsp;delayMillis,
  672. boolean&nbsp;end,
  673. boolean&nbsp;reOpen)</pre>
  674. <div class="block">Creates and starts a Tailer for the given file with default buffer size.</div>
  675. <dl>
  676. <dt><span class="paramLabel">Parameters:</span></dt>
  677. <dd><code>file</code> - the file to follow.</dd>
  678. <dd><code>listener</code> - the TailerListener to use.</dd>
  679. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  680. <dd><code>end</code> - Set to true to tail from the end of the file, false to tail from the beginning of the file.</dd>
  681. <dd><code>reOpen</code> - whether to close/reopen the file between chunks</dd>
  682. <dt><span class="returnLabel">Returns:</span></dt>
  683. <dd>The new tailer</dd>
  684. </dl>
  685. </li>
  686. </ul>
  687. <a name="create-java.io.File-org.apache.commons.io.input.TailerListener-long-">
  688. <!-- -->
  689. </a>
  690. <ul class="blockList">
  691. <li class="blockList">
  692. <h4>create</h4>
  693. <pre>public static&nbsp;<a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a>&nbsp;create(<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;file,
  694. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener,
  695. long&nbsp;delayMillis)</pre>
  696. <div class="block">Creates and starts a Tailer for the given file, starting at the beginning of the file</div>
  697. <dl>
  698. <dt><span class="paramLabel">Parameters:</span></dt>
  699. <dd><code>file</code> - the file to follow.</dd>
  700. <dd><code>listener</code> - the TailerListener to use.</dd>
  701. <dd><code>delayMillis</code> - the delay between checks of the file for new content in milliseconds.</dd>
  702. <dt><span class="returnLabel">Returns:</span></dt>
  703. <dd>The new tailer</dd>
  704. </dl>
  705. </li>
  706. </ul>
  707. <a name="create-java.io.File-org.apache.commons.io.input.TailerListener-">
  708. <!-- -->
  709. </a>
  710. <ul class="blockList">
  711. <li class="blockList">
  712. <h4>create</h4>
  713. <pre>public static&nbsp;<a href="../../../../../org/apache/commons/io/input/Tailer.html" title="class in org.apache.commons.io.input">Tailer</a>&nbsp;create(<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;file,
  714. <a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input">TailerListener</a>&nbsp;listener)</pre>
  715. <div class="block">Creates and starts a Tailer for the given file, starting at the beginning of the file
  716. with the default delay of 1.0s</div>
  717. <dl>
  718. <dt><span class="paramLabel">Parameters:</span></dt>
  719. <dd><code>file</code> - the file to follow.</dd>
  720. <dd><code>listener</code> - the TailerListener to use.</dd>
  721. <dt><span class="returnLabel">Returns:</span></dt>
  722. <dd>The new tailer</dd>
  723. </dl>
  724. </li>
  725. </ul>
  726. <a name="getFile--">
  727. <!-- -->
  728. </a>
  729. <ul class="blockList">
  730. <li class="blockList">
  731. <h4>getFile</h4>
  732. <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;getFile()</pre>
  733. <div class="block">Return the file.</div>
  734. <dl>
  735. <dt><span class="returnLabel">Returns:</span></dt>
  736. <dd>the file</dd>
  737. </dl>
  738. </li>
  739. </ul>
  740. <a name="getRun--">
  741. <!-- -->
  742. </a>
  743. <ul class="blockList">
  744. <li class="blockList">
  745. <h4>getRun</h4>
  746. <pre>protected&nbsp;boolean&nbsp;getRun()</pre>
  747. <div class="block">Gets whether to keep on running.</div>
  748. <dl>
  749. <dt><span class="returnLabel">Returns:</span></dt>
  750. <dd>whether to keep on running.</dd>
  751. <dt><span class="simpleTagLabel">Since:</span></dt>
  752. <dd>2.5</dd>
  753. </dl>
  754. </li>
  755. </ul>
  756. <a name="getDelay--">
  757. <!-- -->
  758. </a>
  759. <ul class="blockList">
  760. <li class="blockList">
  761. <h4>getDelay</h4>
  762. <pre>public&nbsp;long&nbsp;getDelay()</pre>
  763. <div class="block">Return the delay in milliseconds.</div>
  764. <dl>
  765. <dt><span class="returnLabel">Returns:</span></dt>
  766. <dd>the delay in milliseconds.</dd>
  767. </dl>
  768. </li>
  769. </ul>
  770. <a name="run--">
  771. <!-- -->
  772. </a>
  773. <ul class="blockList">
  774. <li class="blockList">
  775. <h4>run</h4>
  776. <pre>public&nbsp;void&nbsp;run()</pre>
  777. <div class="block">Follows changes in the file, calling the TailerListener's handle method for each new line.</div>
  778. <dl>
  779. <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
  780. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true#run--" title="class or interface in java.lang">run</a></code>&nbsp;in interface&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a></code></dd>
  781. </dl>
  782. </li>
  783. </ul>
  784. <a name="stop--">
  785. <!-- -->
  786. </a>
  787. <ul class="blockListLast">
  788. <li class="blockList">
  789. <h4>stop</h4>
  790. <pre>public&nbsp;void&nbsp;stop()</pre>
  791. <div class="block">Allows the tailer to complete its current loop and return.</div>
  792. </li>
  793. </ul>
  794. </li>
  795. </ul>
  796. </li>
  797. </ul>
  798. </div>
  799. </div>
  800. <!-- ========= END OF CLASS DATA ========= -->
  801. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  802. <div class="bottomNav"><a name="navbar.bottom">
  803. <!-- -->
  804. </a>
  805. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  806. <a name="navbar.bottom.firstrow">
  807. <!-- -->
  808. </a>
  809. <ul class="navList" title="Navigation">
  810. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  811. <li><a href="package-summary.html">Package</a></li>
  812. <li class="navBarCell1Rev">Class</li>
  813. <li><a href="class-use/Tailer.html">Use</a></li>
  814. <li><a href="package-tree.html">Tree</a></li>
  815. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  816. <li><a href="../../../../../index-all.html">Index</a></li>
  817. <li><a href="../../../../../help-doc.html">Help</a></li>
  818. </ul>
  819. </div>
  820. <div class="subNav">
  821. <ul class="navList">
  822. <li><a href="../../../../../org/apache/commons/io/input/TaggedInputStream.html" title="class in org.apache.commons.io.input"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  823. <li><a href="../../../../../org/apache/commons/io/input/TailerListener.html" title="interface in org.apache.commons.io.input"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  824. </ul>
  825. <ul class="navList">
  826. <li><a href="../../../../../index.html?org/apache/commons/io/input/Tailer.html" target="_top">Frames</a></li>
  827. <li><a href="Tailer.html" target="_top">No&nbsp;Frames</a></li>
  828. </ul>
  829. <ul class="navList" id="allclasses_navbar_bottom">
  830. <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  831. </ul>
  832. <div>
  833. <script type="text/javascript"><!--
  834. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  835. if(window==top) {
  836. allClassesLink.style.display = "block";
  837. }
  838. else {
  839. allClassesLink.style.display = "none";
  840. }
  841. //-->
  842. </script>
  843. </div>
  844. <div>
  845. <ul class="subNavList">
  846. <li>Summary:&nbsp;</li>
  847. <li>Nested&nbsp;|&nbsp;</li>
  848. <li>Field&nbsp;|&nbsp;</li>
  849. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  850. <li><a href="#method.summary">Method</a></li>
  851. </ul>
  852. <ul class="subNavList">
  853. <li>Detail:&nbsp;</li>
  854. <li>Field&nbsp;|&nbsp;</li>
  855. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  856. <li><a href="#method.detail">Method</a></li>
  857. </ul>
  858. </div>
  859. <a name="skip.navbar.bottom">
  860. <!-- -->
  861. </a></div>
  862. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  863. <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>
  864. </body>
  865. </html>