-
- public static void main(String[] aArgs) throws Exception {
-
- DirectoryMonitor monitor = new DirectoryMonitor(new File("."),
- new AwkFilenameFilter(".*\\.txt"), new DirectoryMonitor.Listener() {
- public void fileChanged(File aFile) {
- System.out.println("changed " + aFile);
- }
- public void fileCreated(File aFile) {
- System.out.println("created " + aFile);
- }
- public void fileDeleted(File aFile) {
- System.out.println("deleted " + aFile);
- }
- });
-
- for (;;) {
+ public static void main(String[] aArgs) throws Exception {
+ DirectoryMonitor monitor = new DirectoryMonitor(new File("."),
+ new RegexFilenameFilter(".*\\.txt"), new DirectoryMonitor.Listener() {
+ public void fileChanged(File aFile) {
+ System.out.println("changed " + aFile);
+ }
+
+ public void fileCreated(File aFile) {
+ System.out.println("created " + aFile);
+ }
+
+ public void fileDeleted(File aFile) {
+ System.out.println("deleted " + aFile);
+ }
+ });
+
+ for (;;) {