Does anybody know, what exactly "optional specific exception" means?
https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html
Some JVMs throw it and some not? If they don't do it, throw they a general IOException or no exception at all? It there a statistic over different implementations, how "optional" it really is?
From the book "Java I/O, NIO and NIO.2" by Jeff Friesen:
FileAlreadyExistsException
is an example of an optional specific exception. It's optional because it's thrown when the underlying operating system can detect the specific error leading to the exception. If the error cannot be detected, itsIOException
ancestor is thrown instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With