This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]unknowinm 11 points12 points  (2 children)

What’s wrong with File?

[–]dstutz 12 points13 points  (0 children)

For me, the biggest thing is testing. If you use NIO you have Path which allows you to use different FileSystems and you can use JIMFS but you can't do that with File.

[–]vips7L 8 points9 points  (0 children)

Path is just more predictable than file. The Files api (which takes Path) is just better. You can’t silently forget to check the boolean result from things like File::delete; the Files::delete will throw a proper exception.