1 Reply Latest reply on Jun 27, 2005 8:43 PM by genman

    File Watcher

    klharrel

      Is there an MBean in Jboss that watches a specified directory and fires off some event if a file suddenly appears in that directory? We really don't want to use a timer to constantly check this directory.

      We're wanting to fire off some code when a user ftps a file up to our server.

      Any ideas would be appreciated.

      Thanks,
      k

        • 1. Re: File Watcher
          genman

          I don't think Java has an API to "watch" a directory. Some OSes can do it by registering with the operating system I hear.

          Directory scanning is very fast and cheap anyway. Talk about premature optimization...