RFR: 8298318: (fs) APIs for handling filename extensions

Alan Bateman alanb at openjdk.org
Wed Oct 18 06:08:42 UTC 2023


On Tue, 17 Oct 2023 19:52:14 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`.

I'm too busy right now to spend time on this one but from a quick glance, the proposed addExtension and removeExtension  looks very strange. I think it would be useful to show some examples using them to justify why are needed. Also write out some candidate method names. A Path is immutable so I don't think you want methods with names like addXXX or removeXXX as the resulting usages will look like they mutate the Path.

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

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


More information about the nio-dev mailing list