commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Enyedi <>
Subject [vfs] Disabling default file caching
Date Tue, 22 Nov 2005 23:34:20 GMT

During the migration of JCommander's backend to VFS I found out about the
default file caching that VFS does.
For instance FileObject.getChildren() by default returns the same children
across multiple calls regardless of the changes that happened on the disk
between two identical calls.

I'm not entirely sure if having the cache activated by default is
necessarily a good idea, but this is a separate discussion.

Now I am trying to disable the caching by using a StandardFileManager
instance configured this way:

StandardFileSystemManager standardManager = new StandardFileSystemManager();
standardManager.setFilesCache(new NullFilesCache());
standardManager.setConfiguration(configFile); // configFile is a valid URL

I intend to use this manager instead of the default one obtained using the
handy VFS.getManager() call.

Unfortunately this isn't really working because it seems that the file
system providers aren't really loaded. And I also get a NullPointerException
while trying to get the parent file for a root FileObject.

Could someone help out with what I'm trying to achieve? Has anyone dealt
with this issue before?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message