RFR: 8298318: (fs) APIs for handling filename extensions [v2]
Roger Riggs
rriggs at openjdk.org
Mon Nov 27 17:02:13 UTC 2023
On Mon, 20 Nov 2023 23:30: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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - 8298318: Correct type in path.getExtension spec
> - Merge
> - 8298318: (fs) APIs for handling filename extensions
Two popular Java libraries for file access and path utilities are Apache Commons and Guava, both do not consider the "." to be part of the extension. They also do not consider a leading "." to be a delimiter of an extension.
It may cause confusion for Java developers and lead to bugs to add an API with different conventions.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16226#issuecomment-1828252931
More information about the nio-dev
mailing list