Community
Participate
Working Groups
Javadocs of IFileInfo.getLength() say that for folders, EFS.NONE should always be returned. But on Linux (tried RHEL 4 and RHEL 5), when the folder is on an NFS-shared file system (in my case, my UNIX user home is on NFS shared from an other Redhat box), the length returned may be different (4096 in my case).
Created attachment 113986 [details] Unittest exposing the issue
Created attachment 113994 [details] Patch fixing the code Attached patch fixes the code to comply with the API specification (untested!). Given that java.io.File#getLength() API is specified to be "undefined" for folders, I'm actually sligthly more in favor of doing an API specification update in IFileInfo#getLength() to specify the length as undefined, instead of changing the code.
Created attachment 113998 [details] Alternative patch with API specification update
+1 for Alternative patch. We could mention that the value depends on the file system provider implementation.
+1 also for the alternative patch. I have released this fix. I can't think of any case where a client would care about the length of a directory. Since the java.io.File implementation and the Linux implementation were not obeying the spec it's unlikely anyone was relying on this.