OpenOptions on newInputStream.
Salter, Thomas A
Thomas.Salter at unisys.com
Tue Sep 6 12:43:55 PDT 2011
FileSystemProvider.newInputStream disallows any OpenOption other than StandardOpenOption.Read. Thus it can't be used to specify a LinkOption or an implementation-defined extension. Was this really the intention?
FileSystemProvider.newOutputStream, on the other hand, explicitly disallows StandardOpenOption.Read but allows everything else.
I can fix this by overriding the FileSystemProvider implementation in my provider, but it doesn't seem like I should have to do that.
On a related note, there seems to be a lack of completeness with the various shortcuts for opening files:
1. Files.newBufferedReader does not take open options, but Files.newBufferedWriter does.
2. Files.newByteChannel takes a FileAttribute parameter, but Files.newBufferedWriter and newOutputStream do not, even though all can create files.
Tom Salter
Unisys
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20110906/78534109/attachment.html
More information about the nio-discuss
mailing list