lol
This commit is contained in:
commit
613bef2496
108 changed files with 8397 additions and 0 deletions
29
src/zutil/test/FileChangedTest.java
Normal file
29
src/zutil/test/FileChangedTest.java
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package zutil.test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import zutil.FileChangeListener;
|
||||
import zutil.FileFinder;
|
||||
import zutil.FileWatcher;
|
||||
|
||||
public class FileChangedTest implements FileChangeListener{
|
||||
public static void main(String[] args) throws URISyntaxException, FileNotFoundException{
|
||||
FileWatcher watcher = new FileWatcher(FileFinder.find("test.txt"));
|
||||
watcher.setListener(new FileChangedTest());
|
||||
|
||||
while(true){
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void fileChangedEvent(File file) {
|
||||
System.out.println(file);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue