1

I have a service monitoring a folder with apache vfs2. All works fine but for some files my custom listeners are not fired and I don't know why. I only see this log :

org.apache.commons.vfs2.cache.SoftRefFilesCache  - putFile: file:///somefile.pdf

Here is my configuration:

  FileListener listener = new MyCustomFileListener();

  DefaultFileMonitor fileMonitor = new DefaultFileMonitor(listener);
  fileMonitor.setRecursive(false);

  FileSystemManager fsManager = VFS.getManager();
  FileObject listenDir = fsManager.resolveFile(path);    

  fileMonitor.addFile(listenDir);
  fileMonitor.start();

This service is running on Red Hat Environment.

Any idea what I'm doing wrong?

Thanks.

Gerard Ribas
  • 717
  • 1
  • 9
  • 17
  • This is probably way too late, but is `path` a directory on a share? If so, http://stackoverflow.com/questions/8476419/java-watchservice-not-generating-events-while-watching-mapped-drives might be the unfortunate answer. – sfedak Jul 22 '16 at 13:31

0 Answers0