2010/11/10 Sébastien Roux <roux.sebast...@gmail.com>:
> I'm not a Java specialist but quite curious about the new tailer classes in
> commons IO 2.0.
>
> Now what does this mean : TailerListener listener = ...

Its just an abbreviation to show the line is not complete.

You have to create your own TailerListener implementation which does
whatever you want with the lines added to the file. So for example you
could do something like the following:

    /**
     * TailerListener implementation.
     */
    public class ShowLinesListener extends TailerListenerAdapter {
        @Override
        public void handle(String line) {
            System.out.println(line);
        }
    }

Then create the Tailer with your implementation:

    TailerListener listener = new ShowLinesListener();
    Tailer tailer = Tailer.create(file, listener, delay);

http://commons.apache.org/io/api-release/org/apache/commons/io/input/Tailer.html

Niall

> I mean what I am supposed to put after the equal? Would you have a quick
> example regarding basic file tailing implementation?
>
> I also checked this without getting the picture =>
> http://permalink.gmane.org/gmane.comp.jakarta.commons.scm/9636
>
> Many thanks for any guidance you may provide.
>
> Sébastien Roux
> mail:  roux.sebast...@gmail.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

Reply via email to