> On Nov 15, 2019, at 2:59 AM, Alan Bateman <alan.bate...@oracle.com> wrote: > > On 02/11/2019 00:13, Brian Burkhalter wrote: >> For this issue [1], please review this patch [2] and the corresponding CSR >> [3]. >> >> > One thing that isn't clear is how these methods behave when the space info > can't be obtained. It is specified to return 0L when the path is not "a > partition" but I think it also returns 0L when the information cannot be > obtained.
It checks whether it has read permission, as documented, and also whether the path string is invalid. In the latter case 0L is returned. Zero is also returned if statfs(2) fails (returns -1). This is different behavior from FileStore.getXSpace() which throws an IOException if statfs fails. For the File.getXSpace() case, then perhaps something like this would be better documentation of return: "The size, in bytes, of the partition or 0L if this abstract pathname is not a valid path or the information cannot be obtained." Brian