[jboss-dev-forums] [JBoss Microcontainer Development] - Re: Missing VirtualFile::isFile?

david.lloyd@jboss.com do-not-reply at jboss.com
Mon Oct 19 09:57:55 EDT 2009


In VFS3, VFS doesn't know (or care) if a file is an archive, unless a deployer has mounted it.  VFS3's "isLeaf()" is deprecated and just returns "! isDirectory()".  However, isDirectory() only returns true if the entry is known to be a directory; a false value might mean that yes it's a directory but it's not accessible for some reason (permissions etc.).  So I think I will add an isFile() method and make isLeaf() call that instead... or maybe simply remove isLeaf() altogether.

A getType() would be the best API of all, but Java gives us no way to guarantee we have the right answer in a consistent and race-free manner.  Maybe with JDK7...

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261071#4261071

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261071



More information about the jboss-dev-forums mailing list