Class SimpleFileResolver
- java.lang.Object
-
- dk.netarkivet.common.utils.service.SimpleFileResolver
-
- All Implemented Interfaces:
FileResolver
public class SimpleFileResolver extends Object implements FileResolver
A simple file resolver for resolving local files against a parent directory to get Path objects representing these files
-
-
Constructor Summary
Constructors Constructor Description SimpleFileResolver(Path directory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Path
getPath(String filename)
Return a single path to a given file, or null if the file is not found.List<Path>
getPaths(Pattern filepattern)
Return a list of file-paths matching a given pattern.void
setDirectory(Path directory)
-
-
-
Constructor Detail
-
SimpleFileResolver
public SimpleFileResolver(Path directory)
-
-
Method Detail
-
setDirectory
public void setDirectory(Path directory)
-
getPaths
public List<Path> getPaths(Pattern filepattern)
Description copied from interface:FileResolver
Return a list of file-paths matching a given pattern. Empty if there are no matching files.- Specified by:
getPaths
in interfaceFileResolver
- Parameters:
filepattern
- String to match.- Returns:
- The list of matching file-paths.
-
getPath
public Path getPath(String filename)
Description copied from interface:FileResolver
Return a single path to a given file, or null if the file is not found.- Specified by:
getPath
in interfaceFileResolver
- Parameters:
filename
- The filename to resolve.- Returns:
- Path representing the file.
-
-