RFR 8057113: (fs) Path should have a method to test the filename extension
daniel.fuchs at oracle.com
Thu Feb 15 17:04:58 UTC 2018
185 String path = toString();
shouldn't this be
String path = getFileName().toString()?
I wonder if the specification of getExtension() should
be defined has being a substring of getFileName()?
On 15/02/2018 16:54, Brian Burkhalter wrote:
> I updated the patch to add to j.n.f.Path
> String getExtension()
> instead of
> boolean hasExtension(String…).
> The previously mentioned use case of a given file type having multiple possible extensions may be trivially handled for example as
> Set.of(“jpg”, “JPG”, “jpeg”).contains(path.getExtension())
> The class javadoc of Path was also updated to put the concept of extension in context.
More information about the nio-dev