Difference between revisions of "Java Recursively Delete a Directory"

From NovaOrdis Knowledge Base
Jump to: navigation, search
(Created page with "=External= * https://www.baeldung.com/java-delete-directory =Internal= * NIO 2 File API")
 
(Internal)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
  
 
=Internal=
 
=Internal=
 +
* [[Java#Subjects|Java]]
 
* [[NIO 2 File API]]
 
* [[NIO 2 File API]]
 +
 +
=Overview=
 +
 +
<syntaxhighlight lang='java'>
 +
Files.walk(configFrameworkRoot.toPath())
 +
        .sorted(Comparator.reverseOrder())
 +
        .map(Path::toFile)
 +
        .forEach(File::delete);
 +
</syntaxhighlight>

Latest revision as of 20:37, 11 February 2020

External

Internal

Overview

Files.walk(configFrameworkRoot.toPath())
         .sorted(Comparator.reverseOrder())
         .map(Path::toFile)
         .forEach(File::delete);