Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-69

FTPFileObject monitor doesn't retrieve lastModifiedTime

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • Windows XP, Java version 1.4.2 (this is the version of Java that WebSphere Portal 5.1 runs on), WebSphere Portal

    Description

      Monitoring of files on a ftp server using DefaultFileMonitor doesn't seem to register changes in the last modified time.

      From the email correspondance with Mario:

      1.
      This is how I've set up my DefaultFileMonitor:

      DefaultFileMonitor fm = new DefaultFileMonitor(new FileListener() {
      public void fileCreated(FileChangeEvent arg0) throws Exception

      { System.out.println("File created. " + arg0.getFile().getName()); }

      public void fileDeleted(FileChangeEvent arg0) throws Exception

      { System.out.println("File deleted. " + arg0.getFile().getName()); }

      public void fileChanged(FileChangeEvent arg0) throws Exception

      { System.out.println("File changed. " + arg0.getFile().getName()); }

      });

      fm.setDelay(60000);
      fm.addFile(file);
      fm.start();

      2.
      Thanks for the code snipped. I tried it with the default
      VFS.getManager() (without setting the CacheStrategy) and it works here with my ftp server as expected.
      I am pretty sure for your tests you do not use a delay of 60000, do you?
      I tried it with 5000 (5 seconds) and get the events promptly.
      But ...... I pointed the monitor to a directory ....

      > And this is how I run my checks:
      >
      > try {
      > for (int i = 0; 1 < 100; i++)

      { > Thread.sleep(60000); // 1 minute > System.out.println(file.getContent().getLastModifiedTime() + " " > + file.getName()); > }

      > } catch (InterruptedException ie)

      { > ie.printStackTrace(); > }

      >
      .... ok - got it. Its a bug in the FTPFileObject, unhappily I have no workaround yet.

      Thank you for your help and sorry again for the extra work.

      Attachments

        Activity

          People

            imario Mario Ivankovits
            firesoft Tony Cooke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: