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

Brian Burkhalter bpb at openjdk.org
Wed Mar 13 20:35:41 UTC 2024


On Tue, 12 Mar 2024 23:00:45 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: Revise handling of leading periods

For `withExtension`, throwing a `NullPointerException` if `extension == null` or an `IllegalArgumentExcepion` if the first character of `extension` is a period character seem like good ideas. Thanks.

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

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


More information about the nio-dev mailing list