Interface FileResolver
- All Known Implementing Classes:
DirectoryFileResolver
public interface FileResolver
Resolves file paths from a manifest to their content.
Abstracts the underlying storage (filesystem directory, zip, etc.)
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether a file exists at the given relative path.Lists all files under a directory path.Resolves a relative path to an input stream.default PathresolveAbsolutePath(String relativePath) Resolves a relative path to an absolute filesystem path.
-
Method Details
-
resolve
Resolves a relative path to an input stream.- Parameters:
relativePath- path relative to the content root (e.g. "panels/dashboard/form.xml")- Returns:
- input stream for the file content
- Throws:
IOException- if the file cannot be read or does not exist
-
listFiles
Lists all files under a directory path. Used for library imports where the manifest points to a directory.- Parameters:
directoryPath- relative directory path (e.g. "libraries/tema-corporativo/")- Returns:
- list of relative file paths under the directory
- Throws:
IOException- if the directory cannot be read
-
exists
Checks whether a file exists at the given relative path.- Parameters:
relativePath- path relative to the content root- Returns:
- true if the file exists and is readable
-
resolveAbsolutePath
Resolves a relative path to an absolute filesystem path. Used when a tool (e.g. Liquibase) needs direct filesystem access.- Returns:
- the absolute path, or null if this resolver is not filesystem-backed
-