klyn.io.FolderPath.removeAll
method
public removeAll() as Void throws IOException
Description

Recursively removes the folder content and the folder itself.

The parent folder is never removed, even when it becomes empty.

Paths built from a parent-traversal segment (..) are rejected even after path normalization, preventing an accidental deletion of an ancestor directory.

Throws
  • IOException if the path contains parent traversal or recursive deletion fails.
Example
parent = FolderPath(Path.tempDir, "klyn-example")
child = FolderPath(parent, "child")
child.mkdirs()
child.removeAll()
assert parent.exists
assert not child.exists