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

Alan Bateman Alan.Bateman at oracle.com
Wed Feb 14 07:38:56 UTC 2018

On 14/02/2018 04:23, Brian Burkhalter wrote:
> https://bugs.openjdk.java.net/browse/JDK-8057113
> http://cr.openjdk.java.net/~bpb/8057113/webrev.00/
> As a first cut at this problem, this patch would add a new method hasExtension() to the java.nio.file.Path interface with a default implementation. The implementation is overridden only by UnixPath. ZipPath does not override it but perhaps should.
> Regression tests passed on all platforms both with and without the UnixPath changes (in order to verify the default implementation on all platforms).
> Obviously a CSR will be in order.
I don't think this is the right API to add. While it has issues, I think 
we need to look at getExtension that returns as String. An important 
point is that the API will need to define what an extension is because 
it currently doesn't have this notion.


More information about the nio-dev mailing list