Skip to content

Instantly share code, notes, and snippets.

@sakamotodesu
Created August 22, 2013 22:18
Show Gist options
  • Save sakamotodesu/6313522 to your computer and use it in GitHub Desktop.
Save sakamotodesu/6313522 to your computer and use it in GitHub Desktop.
TailerListenerTest
public class MyTailerListener extends TailerListenerAdapter {
private String pre = "";
@Override
public void handle(String line) {
if (pre.equals(line)) {
System.out.println("dup : " + line);
}
pre = line;
}
}
public class TailerTest {
public static void main(String[] args) {
TailerListener listener = new MyTailerListener();
final File test = new File("/tmp/test.txt");
Tailer tailer = new Tailer(test, listener);
tailer.run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment