Example usage for org.apache.commons.io.input TailerListener init

List of usage examples for org.apache.commons.io.input TailerListener init

Introduction

In this page you can find the example usage for org.apache.commons.io.input TailerListener init.

Prototype

public void init(Tailer tailer);

Source Link

Document

The tailer will call this method during construction, giving the listener a method of stopping the tailer.

Usage

From source file:com.dotmarketing.servlets.taillog.Tailer.java

/**
 * Creates a Tailer for the given file, with a delay other than the default 1.0s.
 * @param file the file to follow./*from w ww . j  a  v a  2s . c om*/
 * @param listener the TailerListener to use.
 * @param delay the delay between checks of the file for new content in milliseconds.
 * @param end Set to true to tail from the end of the file, false to tail from the beginning of the file.
 */
public Tailer(File file, TailerListener listener, long delay, boolean end) {
    super(file, listener, delay, end);
    this.file = file;
    this.delay = delay;
    this.end = end;

    // Save and prepare the listener
    this.listener = listener;
    listener.init(this);
}