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

Brian Burkhalter bpb at openjdk.org
Mon Oct 30 21:10:33 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`.

This request could be reformulated as a list of three different topics:

1. the definition of a filename extension;
2. the extraction of the filename extension from a `Path`; and
3. the manipulation of the filename extension of a `Path` (to produce another `Path`).

The contention thus far is centered around the third item and I conjecture that the first two items likely have a good level of consensus. I winder therefore whether it might be better to break this proposal into two proposals, the first consisting of the the first two items in the list, and the second of the third item.

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

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


More information about the nio-dev mailing list