public abstract class FileUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
FILE_EXTENSION_PATTERN
Constant that defines the
Pattern used for matching file
extensions. |
static String |
WILDCARD_GLOB_PATTERN
Constant that defines the wildcard (*) glob pattern used for filtering
Path elements. |
| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static List<Path> |
listFiles(Path path,
String globPattern)
Returns a list of
Path elements representing entries within the
specified directory path, filtered by the specified globbing
pattern. |
static List<Path> |
listFiles(String path)
Returns a list of
Paths for the specified string representing a
directory path. |
static List<Path> |
listFiles(URI path)
|
public static final String WILDCARD_GLOB_PATTERN
Path elements.public static List<Path> listFiles(String path) throws IOException
Paths for the specified string representing a
directory path.
This method uses the default glob pattern specified by
WILDCARD_GLOB_PATTERN.
path - the path to the directoryPaths for the specified directory pathIOException - if an I/O error occurspublic static List<Path> listFiles(URI path) throws IOException
Paths for the specified URI
representing a directory path.
This method uses the default glob pattern specified by
WILDCARD_GLOB_PATTERN.
path - the path to the directoryPaths for the specified directory pathIOException - if an I/O error occurspublic static List<Path> listFiles(Path path, String globPattern) throws IOException
Path elements representing entries within the
specified directory path, filtered by the specified globbing
pattern.
If the globPattern is null, the default glob pattern
WILDCARD_GLOB_PATTERN will be used.
If the globPattern matches a file extension (e.g. .txt), the
WILDCARD_GLOB_PATTERN will be prepended to the
globPattern (e.g. *.txt).
path - the path to the directoryglobPattern - the glob patternPaths for the specified directory path and
glob patternIOException - IOException if an I/O error occursFiles#newDirectoryStream(Path, String)}Copyright © 2014 The Cancer Genome Atlas (TCGA) Data Coordination Center (DCC). All rights reserved.