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

Brian Burkhalter bpb at openjdk.org
Mon Mar 11 20:13:15 UTC 2024


On Thu, 7 Mar 2024 22:46:06 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: corretions to commit 030a250aaf4c309d515507527932b233f210501e

> The invariant effectively says "the extension always comes at the very end of the filename" _and_ "the extension separator is a dot".

That is exactly how "extension" has been defined.

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

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


More information about the nio-dev mailing list