-
1. Re: Missing VirtualFile::isFile?
starksm64 Jan 31, 2009 6:55 PM (in response to alesj)The reasoning was that it was too much of a file system notion that did not have a useful meaning in general while isLeaf does. Why would hotdeployment not check a jar when it would check the corresponding unpacked form of the jar as a directory?
The thing we did consider was an isArchive notion for a compressed directory. -
2. Re: Missing VirtualFile::isFile?
alesj Feb 1, 2009 3:08 AM (in response to alesj)"scott.stark@jboss.org" wrote:
The reasoning was that it was too much of a file system notion that did not have a useful meaning in general while isLeaf does.
Sure.
But I'm saying that only isLeaf is not enough.
See the usage in next paragraph."scott.stark@jboss.org" wrote:
Why would hotdeployment not check a jar when it would check the corresponding unpacked form of the jar as a directory?
I'm not saying you wouldn't check it.
There is just no need to go and check the META-INF/*.xml changes,
since the change would already reflect on the root's lastModifiedTime.
But in order to know not to go 'in', is the isFile/isArchive directive."scott.stark@jboss.org" wrote:
The thing we did consider was an isArchive notion for a compressed directory.
JarHandler/ZipContextHandler::isArchive==true, everybody else == false? -
3. Re: Missing VirtualFile::isFile?
starksm64 Feb 2, 2009 12:58 AM (in response to alesj)"alesj" wrote:
JarHandler/ZipContextHandler::isArchive==true, everybody else == false?
Yes, but there could be other archive schemes in the future like tar. -
4. Re: Missing VirtualFile::isFile?
dmlloyd Oct 19, 2009 9:57 AM (in response to alesj)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...