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

Roger Riggs rriggs at openjdk.org
Wed Mar 13 19:57:19 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

The description is intended to have consistent results across different OS and file system types.
As written it does not need any specific mention of hidden files and also guards against a file name that does not have a root and only has an extension. The "." is only a separator (for an extension) if non-empty strings come before and after.

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

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


More information about the nio-dev mailing list