Find a File in a Directory and Subdirectories in Java
Find a file in a directory and its subdirectories in Java with Files.find(), Files.walk() and walkFileTree(), with depth limits and globs.
Find a file in a directory and its subdirectories in Java with Files.find(), Files.walk() and walkFileTree(), with depth limits and globs.
Java FileWriter explained with constructors, write and append methods, append mode, the UTF-8 default since Java 18, flush, close and the alternatives.
Java InputStreamReader decodes bytes from an InputStream into characters. Learn charsets, read methods, malformed input, closing rules and alternatives.
Learn the Java FileReader class with UTF-8 charset constructors, char[] and line reading, error handling and when to use Files.newBufferedReader instead.
List all files in a directory in Java with Files.list, Files.walk, Files.find and DirectoryStream, incl. recursion, filters by extension and errors.
Unzip a file in Java with ZipFile or ZipInputStream, extract subdirectories, block zip slip and zip bombs, and read archives as a zip file system.
Java BufferedReader examples for readLine(), lines(), mark and reset, buffer size and console input, plus LineNumberReader for line numbers in errors.
Learn to read a properties file in Java with load(), write it with store(), load from the classpath, use defaults, update safely and handle UTF-8.
Java Base64 encode and decode examples with java.util.Base64 for strings, URL-safe tokens, MIME email, files and streams, plus fixes for decoding errors.
Java IO vs NIO compared for Java 25. Streams vs buffers, blocking vs selectors, NIO.2 Files and Path, virtual threads, and a table of which API to use.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.