In this lecture, we break down three key entities of Java’s file API: the historical
File, the modern path abstraction
Path from NIO.2, and the utility “Swiss Army knife” class
Files. In practice, we’ll see how to create objects, convert
File ↔
Path, safely join paths via
resolve, obtain relative paths via
relativize, normalize them with
normalize, and perform operations such as
Files.exists,
Files.copy,
Files.move,
Files.readAllLines/
Files.write. The result is a clear understanding of when to use each approach and which mistakes are most common.