JDK-8369594 : Add a recursive directory deletion method to java.nio.file.Files to simplify del
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2025-10-10
  • Updated: 2025-10-10
Description
A DESCRIPTION OF THE PROBLEM :
Currently, the java.nio.file.Files API provides methods like delete and deleteIfExists which can only delete files or empty directories. Deleting non-empty directories requires manual recursion using Files.walkFileTree(), which is cumbersome and error-prone. Introducing a built-in method for recursive directory deletion would enhance developer productivity, provide a consistent and simple API for common use cases, and reduce boilerplate code.