C H A P T E R  4

Image

Files and Directories

Now that you know how to point to a file or directory using the Path class, you are ready to learn how to accomplish the most common tasks for managing files and directories, such as create, read, write, move, delete, and so on. NIO.2 comes with a set of brand new methods to accomplish these tasks, most of which are found in the java.nio.file.Files class.

The chapter starts by exploring some methods dedicated to checking if a Path is readable, writable, executable, regular, or hidden. These checks enable you to determine what kind of file or directory you are dealing with before you apply operations such ...

Get Pro Java 7 NIO.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.