public final class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanUpTestDirectory(Path directory) |
static void |
copyDirectory(Path source,
Path destination,
CopyOption... options) |
static String |
toFileTreeString(Path root)
Convert a given directory into a visual file tree.
|
public static void cleanUpTestDirectory(Path directory)
public static void copyDirectory(Path source, Path destination, CopyOption... options)
public static String toFileTreeString(Path root)
/tmp/testdir
/tmp/testdir/CHANGELOG.md
/tmp/testdir/README.md
/tmp/testdir/notes
/tmp/testdir/notes/2022
/tmp/testdir/notes/2022/1.txt
/tmp/testdir/notes/important.txt
/tmp/testdir/notes/2021
/tmp/testdir/notes/2021/2.txt
/tmp/testdir/notes/2021/1.txt
Calling this method on /tmp/testdir will yield the following output:
- testdir
- CHANGELOG.md
- README.md
- notes
- 2022
- 1.txt
- important.txt
- 2021
- 2.txt
- 1.txt
Copyright © 2026. All rights reserved.