Loading topic
main method. It also assumes you know what a String is, what a checked exception is, and that you have Java 11 or later installed. Examples use Linux or macOS paths. Where Windows behaves differently, the text says so.5 min readPath with Path.of and know what a relative path and an absolute path are. It builds on that to cover three jobs: joining paths, removing noise from them, and computing the route from one location to another. All of these are pure operations on names. None of4 min readjava.nio.file.Files. It assumes you can write basic Java classes, use String, List and Stream, handle checked exceptions with try/catch, and run Java 11 or later. Later chapters cover each group of methods in detail. Here you learn how the class is organized, 5 min readFiles.readString and Files.writeString. It explains what happens between a Java String and the bytes on disk, and how to stop that step from silently corrupting your data.5 min readPath with Path.of, that you know what a checked exception is, and that you have used String, List and Stream. It also assumes Java 11 or later, because Files.readString arrived in Java 11.5 min readPath, call Files.writeString and Files.readString, and handle a checked IOException. It covers the options you pass to Files methods to change how a file is opened, and the errors those options can cause.4 min readPath, know what Files.readString does, and understand checked exceptions and try/catch. You also need to know that a charset maps characters to bytes. Here you will write whole files in one call, choose between truncating and appending, and avoid the common m4 min readPath and Files basics, try-with-resources, checked exceptions, and why a charset must be named explicitly. It covers how to process a text file one line at a time without loading it all into memory.4 min readFiles.readString and Files.readAllLines, that you know try-with-resources, and that you can use Stream operations such as filter, map and count. You need Java 11 or later.5 min readtry/catch, and the Files read and write methods from earlier chapters. It covers which exceptions file operations throw, how to catch them in a useful order, and how to report failures without hiding the cause.5 min readPath with Path.of, call static methods on Files, and handle IOException with try/catch. Here you learn how to ask the file system about a path without reading its contents: whether it exists, what kind of thing it is, how big it is, and when it changed.4 min readjava.nio.file. It assumes you know Path and Files.writeString, try-with-resources, checked exceptions, and Stream. It also assumes Java 11 or later. Recursive traversal is covered in a later chapter. Here the focus i4 min readFiles methods that copy, move and delete files and directories. It assumes you can build a Path, read basic file attributes, and handle checked exceptions. You should also know that Files.exists and Files.isDirectory exist. Java 11 or later is needed.5 min readFiles.walk, Files.find and Files.walkFileTree. It assumes you know Path, Files, try-with-resources and Stream. It also assumes you know how to list one directory, which the directories chapter covers.4 min readPath and Files, write whole files with Files.writeString, create directories, and use Files.move. It also assumes you know how checked exceptions work. You need Java 11 or later.6 min readPath, the Files class, try-with-resources, and checked exceptions. It also assumes Java 11 or later, where Path.of is available.4 min read