You have learned how to read and write data from a file. However, there is more to file management than reading and writing. The
Files classes encapsulate the functionality required to work with the file system on the user’s machine. For example, use the
Files class to remove or rename the file, or to find out when a file was last modified. In other words, the stream classes are concerned with the contents of files, whereas the classes that we discuss here are concerned with the storage of files on a disk.
Files classes were added in Java SE 7. They are much more convenient to use than the
File class which dates back all the way to JDK 1.0. We expect them to be very popular with Java programmers ...