Java 1.0 included the package java.io with java.io.File, a bunch of buffered and unbuffered I/O-streams and a bunch of stream readers and writers and a few helper classes like java.io.FileFilter. In java.io, File is the pivotal point for file operations (i.e. read, write, delete, checking for access). Here, File implicitly means ‘a file on your local machine’. There wasn’t much of an abstraction. File has a constructor with a URI as parameter, with which you could instantiate a file with a URI like ftp://whatever.org/user/alice/whatever.file, but java.io doesn’t provide the means to access files over FTP.
The java.io.File methods that operate on files are instance methods that signal success or failure by returning boolean. This is quite frustrating in case of a failed operation, because by simply returning a boolean the methods don’t signal the reason for a failure. An exception to this are the java.lang.SecurityException, thrown by java.io.File, which indicates that access to a resource (file) is denied and the java.io.FileNotFoundException, thrown by FileInputStream, FileOutputstream and RandomAccessFile.
In Java 1.4, NIO was introduced with the package java.nio, providing buffers, channels and selectors. NIO yielded more performance improvements when dealing with the handling of multiple sockets, but also a considerable performance improvements when reading or writing files. For both network and file parts, Java 1.4 NIO is a pretty low level API. The performance improvements were gained at the cost of added complexity.
Java 7 introduced asynchronous operations with NIO.2. The extended API provides for features that have been sought by devs since the time of legacy Java file I/O, i.e. easier access to file and filesystem metadata like file permissions. Additionally, the API hides most of the complexity, which reduces the verbosity of client code.
In java.nio, since Java 7, java.nio.Path supersedes java.io.File as the pivotal point for file operations.
Path is an interface, not a concrete class like java.io.File.
Class Paths consists exclusively of static methods that return a Path instance. Since Java 11, Path (note: not Paths) has a static method Path.of that accepts a String as it’s parameter and returns a Path object.
java.nio.Files consists exclusively of static methods for operations on files. Most methods of Files take a Path as their sole parameter, or Path is one of the parameters.
and both return the current directory.
The Files methods that reading a line or writing a string are opening and closing the resource as a convenience for the dev, so no try-with-resources is necessary here.
Java Core Library docs, section 9, Java NIO
Oracle Java Documentation Enhancements in Java I/O