RFR: 8371697: FileStore.getFileAttributeView("dos") should return null if unavailable
SendaoYan
syan at openjdk.org
Fri Nov 14 03:18:07 UTC 2025
On Thu, 13 Nov 2025 07:00:08 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> Files.getFileAttributeView returns a FileAttributeView if the file system provider supports it. I don't think we have an implementation bug here, instead I suspect there is a test issue here.
The[ java API doc](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/nio/file/FileStore.html#getFileStoreAttributeView(java.lang.Class)) says getFileStoreAttributeView returns 'null if the attribute view is not available'. And the getFileStoreAttributeView function [comment](https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/file/Files.java#L1638) also say getFileStoreAttributeView returns 'null if the attribute view is not available'.
If FileStore.supportsFileAttributeView(viewClass) and FileStore.supportsFileAttributeView(viewName) return false, does it means the attribute view is not available? If it does, I think the test do the right thing; If not, maybe we should fix this test.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28281#issuecomment-3530636872
More information about the nio-dev
mailing list