File.getName() vs. Path.getFileName()

Christian Schlichtherle christian at schlichtherle.de
Thu May 26 09:31:12 PDT 2011


File file = new File("");

assert file.getName().isEmpty();

assert null == file.toPath().getFileName();

 

That's a very subtle difference. I'ld prefer to return in
Path.getFileName().

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20110526/0e4c97e0/attachment.html 


More information about the nio-discuss mailing list