The legacy java.io.File class mixed path math with filesystem state and often returned booleans instead of throwing useful diagnostics. NIO.2 (java.nio.file) separates Path (immutable location) from Files (atomic static operations) and makes reading, writing and streaming lines concise.
More lessons in Complete Core Java