public class ResourceUtils extends Object
Modifier and Type | Method and Description |
---|---|
static List<String> |
listClassPathFiles(String path,
boolean recursive,
boolean includeDirectories,
String... extensions)
List all classpath resource files, optionally recursively, inside the specified path/directory
The path argument should be a directory.
|
public static List<String> listClassPathFiles(String path, boolean recursive, boolean includeDirectories, String... extensions)
Resources.normalize(String)
path
- Path in which to list all filesrecursive
- If true: list all files in subdirectories also. If false: only include files in the specified
directory, but not any files in subdirectoriesincludeDirectories
- If true: include any subdirectories in the returned list of files. False: Only return
files, not directoriesextensions
- Optional - may be null (or length 0). If null/length 0: files with any extension are returned
If non-null: only files matching one of the specified extensions are included.
Extensions can we specified with or without "." - i.e., "csv" and ".csv" are the sameCopyright © 2020. All rights reserved.