RFR 8057113: (fs) Path should have a method to test the filename extension

Brian Burkhalter brian.burkhalter at oracle.com
Thu Feb 15 17:59:18 UTC 2018

Daniel / Alan,

On Feb 15, 2018, at 9:22 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 15/02/2018 17:04, Daniel Fuchs wrote:
>> Hi Brian,
>> 185         String path = toString();
>> shouldn't this be
>> String path = getFileName().toString()?

That would simplify things.

>> I wonder if the specification of getExtension() should
>> be defined has being a substring of getFileName()?

Seems like a good idea.

> Right, there are a couple of issues that follow on from that, esp. when you get into Path objects that only have a root component (C: or / for example).

If getFileName() is null then the extension would be empty, at least according to the direction in which I’ve been going.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20180215/02b89ea9/attachment.html>

More information about the nio-dev mailing list