@Test public void testIO335() throws Exception { final long delayMillis = 50; final File file = new File(getTestDirectory(), "tailer-testio334.txt"); createFile(file, 0); final TestTailerListener listener = new TestTailerListener(); tailer = new Tailer(file, listener, delayMillis, false); final Thread thread = new Thread(tailer); thread.start(); writeString(file, "CRLF\r\n", "LF\n", "CR\r", "CRCR\r\r", "trail"); final long testDelayMillis = delayMillis * 10; TestUtils.sleep(testDelayMillis); final List<String> lines = listener.getLines(); assertEquals("line count", 4, lines.size()); assertEquals("line 1", "CRLF", lines.get(0)); assertEquals("line 2", "LF", lines.get(1)); assertEquals("line 3", "CR", lines.get(2)); assertEquals("line 4", "CRCR\r", lines.get(3)); tailer.stop(); tailer=null; thread.interrupt(); TestUtils.sleep(testDelayMillis); }
private void stop(final Exception e) { listener.handle(e); stop(); }
Tailer implements Runnable { private void stop(final Exception e) { listener.handle(e); stop(); } }
Tailer implements Runnable { private void stop(final Exception e) { listener.handle(e); stop(); } Tailer(final File file, final TailerListener listener);  Tailer(final File file, final TailerListener listener, final long delayMillis);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final boolean reOpen);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final int bufSize);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final boolean reOpen, final int bufSize);  Tailer(final File file, final Charset cset, final TailerListener listener, final long delayMillis,
                  final boolean end, final boolean reOpen
            , final int bufSize); }
Tailer implements Runnable { private void stop(final Exception e) { listener.handle(e); stop(); } Tailer(final File file, final TailerListener listener);  Tailer(final File file, final TailerListener listener, final long delayMillis);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final boolean reOpen);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final int bufSize);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final boolean reOpen, final int bufSize);  Tailer(final File file, final Charset cset, final TailerListener listener, final long delayMillis,
                  final boolean end, final boolean reOpen
            , final int bufSize); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end, final int bufSize); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end, final boolean reOpen,
            final int bufSize); static Tailer create(final File file, final Charset charset, final TailerListener listener,
                                final long delayMillis, final boolean end, final boolean reOpen
            ,final int bufSize); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end, final boolean reOpen); static Tailer create(final File file, final TailerListener listener, final long delayMillis); static Tailer create(final File file, final TailerListener listener); File getFile(); long getDelay(); void run(); void stop(); }
Tailer implements Runnable { private void stop(final Exception e) { listener.handle(e); stop(); } Tailer(final File file, final TailerListener listener);  Tailer(final File file, final TailerListener listener, final long delayMillis);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final boolean reOpen);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final int bufSize);  Tailer(final File file, final TailerListener listener, final long delayMillis, final boolean end,
                  final boolean reOpen, final int bufSize);  Tailer(final File file, final Charset cset, final TailerListener listener, final long delayMillis,
                  final boolean end, final boolean reOpen
            , final int bufSize); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end, final int bufSize); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end, final boolean reOpen,
            final int bufSize); static Tailer create(final File file, final Charset charset, final TailerListener listener,
                                final long delayMillis, final boolean end, final boolean reOpen
            ,final int bufSize); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end); static Tailer create(final File file, final TailerListener listener, final long delayMillis,
                                final boolean end, final boolean reOpen); static Tailer create(final File file, final TailerListener listener, final long delayMillis); static Tailer create(final File file, final TailerListener listener); File getFile(); long getDelay(); void run(); void stop();  }