FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Append a line
Append text to a Java file, creating it if necessary.
Java✓ Tested
Create nested directories
Create missing parent directories with Java Files.createDirectories.
Java✓ Tested
List regular files
List immediate regular files in sorted order and close the Java directory stream.
Java✓ Tested
Read a UTF-8 file
Read a small UTF-8 file into a Java string.
Java✓ Tested
Write a UTF-8 file
Write a Java string to a file using an explicit text encoding.
Java✓ Tested