O'Reilly logo

Java I/O, NIO and NIO.2 by Jeff Friesen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    12

Improved File System Interface

NIO.2 improves the file system interface that was previously limited to the java.io.File class. This chapter introduces the improved file system interface’s architecture and shows you how to use the new APIs to accomplish a wide range of file system tasks.

Note  A file system manages files, which are classified as regular files, directories, symbolic links (https://en.wikipedia.org/wiki/Symbolic_link), and hard links (https://en.wikipedia.org/wiki/Hard_link).

Architecting a Better File Class

The File-based file system interface is problematic. Several problems are listed here:

  • Many methods return Boolean values rather than throw exceptions. As a result, you don’t know why an operation fails. For example, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required