commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Poulard <Philippe.Poul...@sophia.inria.fr>
Subject Re: [VFS] VFS.getManager().getFilesCache() - exists() vs findFiles()
Date Wed, 01 Jun 2005 16:59:15 GMT
hi,

I have just resolved a problem due to caching and deletion :
-delete()
-close() <- I found this tip in this thread :)

I understand that close() is needed to flush the cache, but I found a 
problem in this sequence :
-delete()
-copy()
-set-attributes()

I catch an exception telling me that the file didn't exist ; but it does 
exist : i just have create it !!! so, after creation, the cache seems 
not be updated

the solution rigth now is :
-delete()
-close()
-copy()
-set-attributes()

but it is not fair

Mario Ivankovits wrote:
> Andy Lewis wrote:
> 
>> First, what about adding a stat() method on FileObject, something akin
>>  
> 
> I dont want to introduce a new public api function.
> 
> Especially if I think that I have to call stat() immediatly after 
> resolveFile() every time as I am not interested in performance but more 
> in correct results.
> My current code is flooded with nasty close() (instead of stat()) as 
> this is the method which is intended to to the same as stat().
> 
> Sure, I know, it closes all streams (opened by the calling thread), but 
> this is not a problem in this context, moreover it is wanted to behave so.
> This forces a clean state on the remote side.
> 
> I admit, what we can do is to force this during findFiles() ... will see.
> 
>> While it might not solve every case, for example, if you resolve a
>> cached deleted file from a URL using FileSystemManager.resolveFile() -
>> how would that show up? (haven't tested it)
>>  
> 
> No server round trip here, so this file is still marked as "deleted".
> 
> 
> I will have a look in refactoring FileObject to use no internal caching 
> and allow to decorate it with a CacheFileObject with behaves more or 
> less like we see it today.
> And then, we could have such a CacheFileObject.stat() method.
> 
> It should be configureable on FileSystemManager and maybe on FileSystem 
> level.
> And the default might be to use the FileObject without caching.
> 
> ---
> Mario
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


-- 
Cordialement,

            ///
           (. .)
  -----ooO--(_)--Ooo-----
|   Philippe Poulard    |
  -----------------------

---------------------------------------------------------------------
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