Thursday, January 7, 2010

Background Monitoring and Network Folders

Had to fix an interesting issue this morning.  When background monitoring was set to start on boot, sometimes the network folder wasn't ready and an immediate IllegalArgumentException would be thrown.  SwingWorker to the rescue.  I suppose you could use threads just as easily, but the SwingWorker is convienent because it already includes events for when it's done.  So basically, the directory to monitor now has a timeout of about 15 seconds.  If the file is a directory all is well, if not a warning comes up.

No comments:

Post a Comment