public class FileListUtils extends Object
FileSystem.FileSystem| Modifier and Type | Field and Description |
|---|---|
static Comparator<FileStatus> |
LATEST_MOD_TIME_ORDER |
static PathFilter |
NO_OP_PATH_FILTER |
| Constructor and Description |
|---|
FileListUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<FileStatus> |
listFilesRecursively(FileSystem fs,
Iterable<Path> paths) |
static List<FileStatus> |
listFilesRecursively(FileSystem fs,
Path path) |
static List<FileStatus> |
listFilesRecursively(FileSystem fs,
Path path,
PathFilter fileFilter)
Helper method to list out all files under a specified path.
|
static List<FileStatus> |
listFilesRecursively(FileSystem fs,
Path path,
PathFilter fileFilter,
boolean applyFilterToDirectories)
Helper method to list out all files under a specified path.
|
static List<FileStatus> |
listMostNestedPathRecursively(FileSystem fs,
Iterable<Path> paths) |
static List<FileStatus> |
listMostNestedPathRecursively(FileSystem fs,
Path path)
Method to list out all files, or directory if no file exists, under a specified path.
|
static List<FileStatus> |
listMostNestedPathRecursively(FileSystem fs,
Path path,
PathFilter fileFilter)
Method to list out all files, or directory if no file exists, under a specified path.
|
static List<FileStatus> |
listPathsRecursively(FileSystem fs,
Path path,
PathFilter fileFilter)
Helper method to list out all paths under a specified path.
|
public static final Comparator<FileStatus> LATEST_MOD_TIME_ORDER
public static final PathFilter NO_OP_PATH_FILTER
public static List<FileStatus> listFilesRecursively(FileSystem fs, Path path) throws IOException
IOExceptionpublic static List<FileStatus> listFilesRecursively(FileSystem fs, Iterable<Path> paths) throws IOException
IOExceptionpublic static List<FileStatus> listFilesRecursively(FileSystem fs, Path path, PathFilter fileFilter) throws IOException
PathFilter is treated as a file
filter, that is it is only applied to file Paths.IOExceptionpublic static List<FileStatus> listFilesRecursively(FileSystem fs, Path path, PathFilter fileFilter, boolean applyFilterToDirectories) throws IOException
PathFilter will only be applied to files.IOExceptionpublic static List<FileStatus> listMostNestedPathRecursively(FileSystem fs, Path path) throws IOException
IOExceptionpublic static List<FileStatus> listMostNestedPathRecursively(FileSystem fs, Iterable<Path> paths) throws IOException
IOExceptionpublic static List<FileStatus> listMostNestedPathRecursively(FileSystem fs, Path path, PathFilter fileFilter) throws IOException
PathFilter is treated as a file filter, that is it is only applied to file Paths.IOExceptionpublic static List<FileStatus> listPathsRecursively(FileSystem fs, Path path, PathFilter fileFilter) throws IOException
FileSystem is
unable to list the contents of a relevant directory, will log an error and skip.IOException