Created
August 22, 2013 22:18
-
-
Save sakamotodesu/6313522 to your computer and use it in GitHub Desktop.
TailerListenerTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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