RFR: 8057113: (fs) Path should have a method to obtain the filename extension [v3]

Brian Burkhalter bpb at openjdk.java.net
Thu Apr 21 21:22:28 UTC 2022


On Thu, 21 Apr 2022 21:02:47 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8057113: Add hasExtension() and replaceExtension()
>
> src/java.base/share/classes/java/nio/file/Path.java line 355:
> 
>> 353:      *         leading and trailing space is ignored; may contain at most
>> 354:      *         one dot ('.') which if present must be the first character
>> 355:      *         that is not a space
> 
> Is there a use case for supplying the new extension with leading or training space.
> I think the API is clearer if the supplied extension is treated as a literal.

No, I just thought it might be more flexible and forgiving.

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

PR: https://git.openjdk.java.net/jdk/pull/8066


More information about the nio-dev mailing list