Example usage:
...
FindNewFiles fnf;
ArrayList<java.util.File> newFiles;
try {
fnf = new FindNewFiles("/tmp"); /* or windows path */
} catch(Exception e) {
System.out.println("Exception: " + e.getMessage());
return;
}
while(true) {
/* get files which were not in the directory the previous time method was invoked */
newFiles = fnf.findNewFiles();
if(newFiles != null)
{
/* then found new files */
/* do something */
}
/* do something, perhaps sleep */
}
...
No comments:
Post a Comment