19.2 File Systems and Paths
At the center of NIO.2 are the FileSystem and Path types:
-
FileSystem describes a data system and is an abstract class. This type is implemented by concrete file systems, such as the local file system or a ZIP archive. To access the current file system, the FileSystems class declares a static method: FileSystems.getDefault() .
-
Path represents a path to a file or directory, where paths can be relative or absolute. These methods are somewhat reminiscent of the old File class, but one big difference is that File itself represents the file or directory and declares query methods like isDirectory() or lastModified(). In contrast, Path represents only the path and provides only path-related methods. Modification ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access