Java Recursively Delete a Directory: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
* [[Java#Subjects|Java]]
* [[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>

Revision as of 20:37, 11 February 2020

External

Internal

Overview

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