Example #1
0
 /**
  * The FileEvent listener.
  *
  * @param event the event.
  */
 public void fileEventOccurred(FileEvent event) {
   File file = event.getFile();
   if (file != null) {
     String dirPath;
     if (file.isDirectory()) dirPath = file.getAbsolutePath();
     else dirPath = file.getParentFile().getAbsolutePath();
     properties.setProperty("directory", dirPath);
   } else properties.remove("directory");
 }
 @Override
 public void fileDeleted(FileEvent fe) {
   String path = fe.getFile().getPath();
   try {
     pref.node(path).removeNode();
   } catch (BackingStoreException ex) {
     Exceptions.printStackTrace(ex);
   }
 }
 @Override
 public void fileChanged(FileEvent fe) {
   String path = fe.getFile().getPath();
   pref.node(path);
 }
 @Override
 public void fileFolderCreated(FileEvent fe) {
   String path = fe.getFile().getPath();
   pref.node(path);
 }