commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manco <megust...@yahoo.com>
Subject Re: [VFS] VFS.getManager().getFilesCache() - exists() vs findFiles()
Date Wed, 18 May 2005 22:53:13 GMT
ok,  I was thinking the cache was some type of Singleton per jvm, but it sounds like from
your answer that it is FileObject specific. I didn't realize that I could close() a FileObject
and still use it, but the doc below tells otherwise.
 
vfs  FileObject.close() javadoc 
"
Closes this file, and its content. This method is a hint to the implementation that it can
release any resources asociated with the file. 


The file object can continue to be used after this method is called. 
..."

thanks,
Manco

Mario Ivankovits <mario@ops.co.at> wrote:
manco wrote:
> 
>I dont see why the findFiles() sees it but the exist() fails
> 
It has something to do with the cache, this is correct (and it drives me 
crazy, but this will be something for vfs 2.0).
findFiles finds the file on the filesystem but get the cached object 
which might be in state "file deleted".

To refresh its cached informations you could call ".close()" on the 
fileobject in question. This is the intended way to do this.

e.g.

for (FileObject fo : foundFiles)
{
fo.close();
if (fo.exists())
{
......
}
}

---
Mario


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


		
---------------------------------
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message