Files.createFile() makes use of newByteChannel(); what if the fs does _not_ support .newByteChannel()?

Francis Galiegue fgaliegue at gmail.com
Fri Dec 18 19:43:31 UTC 2015


Hello,

On Fri, Dec 18, 2015 at 10:00 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
[...]
>
> The original intention was that all providers must implement newByteChannel
> and the open options listed in the table. In the degnerative case then the
> underlying file system should at least support reading a file sequentially,
> or when it's a read-write file system that is supports writing to a file
> sequentially. Seeking might mean the position(long) method fails of course.
> Also Files.create is specified to be atomic with respect to other file
> system operations and that might be challenge too. It would be good if the
> javadoc could specify the absolute minimum but the original intention was
> not that newByteChannel always throws UOE.
>
> -Alan.

Hmm, OK.

I'm not here yet (I just want to have a first version of all
filesystems working under the same API) but I'll keep that in mind...

Have fun!

Regards,
-- 
Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
JSON Schema in Java: http://json-schema-validator.herokuapp.com
Parsers in pure Java: https://github.com/fge/grappa


More information about the nio-dev mailing list