public final class Directories
extends java.lang.Object
Path objects.| Modifier and Type | Method and Description |
|---|---|
static int |
count(java.nio.file.Path dir)
Count the number of entries in a directory.
|
static java.util.List<java.nio.file.Path> |
list(java.nio.file.Path dir)
Convenience method to return all paths in a SMALL directory.
|
@Nonnegative
public static int count(@Nonnull
java.nio.file.Path dir)
throws java.io.IOException
dir - directory to evaluatejava.io.IOException@Nonnull
public static java.util.List<java.nio.file.Path> list(@Nonnull
java.nio.file.Path dir)
throws java.io.IOException
DO NOT USE THIS TO TRAVERSE LARGE (multi-thousand inode) DIRECTORIES!
For starters you shouldn't be making directories that big at all, but if you did please use
Files#newDirectoryStream(Path) directly in your code.
dir - directory to evaluatejava.io.IOException