You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Tony Cooke (JIRA)" <ji...@apache.org> on 2006/07/07 10:43:29 UTC

[jira] Created: (VFS-69) FTPFileObject monitor doesn't retrieve lastModifiedTime

FTPFileObject monitor doesn't retrieve lastModifiedTime
-------------------------------------------------------

         Key: VFS-69
         URL: http://issues.apache.org/jira/browse/VFS-69
     Project: Commons VFS
        Type: Bug

 Environment: Windows XP, Java version 1.4.2 (this is the version of Java that WebSphere Portal 5.1 runs on), WebSphere Portal
    Reporter: Tony Cooke


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Closed: (VFS-69) FTPFileObject monitor doesn't retrieve lastModifiedTime

Posted by "Mario Ivankovits (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/VFS-69?page=all ]

Mario Ivankovits closed VFS-69.
-------------------------------


> FTPFileObject monitor doesn't retrieve lastModifiedTime
> -------------------------------------------------------
>
>                 Key: VFS-69
>                 URL: http://issues.apache.org/jira/browse/VFS-69
>             Project: Commons VFS
>          Issue Type: Bug
>         Environment: Windows XP, Java version 1.4.2 (this is the version of Java that WebSphere Portal 5.1 runs on), WebSphere Portal
>            Reporter: Tony Cooke
>         Assigned To: Mario Ivankovits
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (VFS-69) FTPFileObject monitor doesn't retrieve lastModifiedTime

Posted by "Mario Ivankovits (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/VFS-69?page=all ]

Mario Ivankovits resolved VFS-69.
---------------------------------

    Resolution: Fixed

Should be fixed now, though, it looks not very performant as we have to refetch the whole parent listing.
Maybe there is room for improvement in the future.

> FTPFileObject monitor doesn't retrieve lastModifiedTime
> -------------------------------------------------------
>
>                 Key: VFS-69
>                 URL: http://issues.apache.org/jira/browse/VFS-69
>             Project: Commons VFS
>          Issue Type: Bug
>         Environment: Windows XP, Java version 1.4.2 (this is the version of Java that WebSphere Portal 5.1 runs on), WebSphere Portal
>            Reporter: Tony Cooke
>         Assigned To: Mario Ivankovits
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org