All languages

Java

You're viewing a free preview. Sign in free to read every script.

Why this exists The modern file API, java.nio.file, replaces the old java.io.File and makes directory work short. The same cleanup task appears in the Shell, Python, PowerShell and Go sections of this library, so you…

Log Cleanup with java.nio: Walking Directories Safely with a Dry Run

Find and delete old log files with Files.walk, handle checked exceptions inside lambdas, protect against dangerous paths, close directory streams properly, report the space involved and delete only when asked.

Sign in free to read this script, along with the rest of the library.

Sign in free