Long story short:
java.io.File
will most likely never be deprecated / unsupported. That said, java.nio.file.Path
is part of the more modern java.nio.file
lib, and does everything java.io.File
can, but generally in a better way, and more.
For new projects, use Path
.
And if you ever need a File
object for legacy, just call Path#toFile()
Migrating from File to Path
Article by Janice J. Heiss and Sharon Zakhour, May 2009, discussing NIO.2 File System in JDK 7