× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks for the info Joe.

Here is the test class that implements the FileListener interface that goes
with this. I'm still in my learning phase with Java and it seems every time
I think I have it figured out, there is one more thing pops up.

I will start with just changing the interval. All I really want to do with
this is fire a program call when a file is added to the directory. At this
point I'm just seeing if it's possible/feasible to do it this way.

public class Test implements FileListener {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Test t = new Test();
DirectoryMonitor dirMon = new DirectoryMonitor(1000);
//FileMonitor dirMon = new FileMonitor(1000);
try {
dirMon.addDirectory(new IFSFile(new AS400("localhost",
"username", "password"), "/home"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
dirMon.addListener(t);

while (!false);
}

public void fileAdded(IFSFile file) {
System.out.println("Added: " + file.getName());
}

public void fileChanged(IFSFile file) {
System.out.println("Changed: " + file.getName());
}

public void fileRemoved(IFSFile file) {
System.out.println("Removed: " + file.getName());
}

}


Thanks,

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.