RFR: 8298318: (fs) APIs for handling filename extensions [v8]

Brian Burkhalter bpb at openjdk.org
Wed Mar 13 23:15:39 UTC 2024


On Wed, 13 Mar 2024 23:12:50 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Add to `java.nio.file.Path` a method `getExtension` to retrieve the `Path`'s extension, and companion methods `removeExtension` and `addExtension`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8298318: Add parameter checks for withExtension

Commit 8abc295f4b61aa8ad9cf272a70408042f1ccbcfa changes `withExtension` to:

1. throw a `NullPointerException` if its parameter is `null`; and
2. throw an `IllegalArgumentException` if its parameter is non-`null` and begins with a period character.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/16226#issuecomment-1996063320


More information about the nio-dev mailing list