commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [commons vfs] ftp DefaultFileMonitor issue
Date Fri, 07 Jul 2006 08:22:38 GMT
Hi!
>> Do not change the FilesCache. Anything else than the SoftRefFilesCache
>> (which is the default) will cause memory leaks and other oddities.
>>     
>
> OK, but using that caching strategy seems to cache files no matter what
> (using ftp that is), even if I use:
>
>   mgr.setCacheStrategy(CacheStrategy.ON_CALL);
>   
There are two kind of caches in VFS, one which is responsible to hand
out the FileObject instance itself - where we try hard to hand out
always the same instance for the same file (=filename/filesystem
combination) and another cache inside the FileObject which holds stuff
like children and file informations.
The CacheStrategy tells the system when to refresh the second cache.

> This is how I've set up my DefaultFileMonitor:
>   
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.
Could you please open a ticket at http://issues.appche.org/jira I'll see
if I can fix it soon.


Ciao,
Mario


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


Mime
View raw message