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 Type
    Method
    Description
    boolean
    exists(String relativePath)
    Checks whether a file exists at the given relative path.
    listFiles(String directoryPath)
    Lists all files under a directory path.
    resolve(String relativePath)
    Resolves a relative path to an input stream.
    default Path
    Resolves a relative path to an absolute filesystem path.
  • Method Details

    • resolve

      InputStream resolve(String relativePath) throws IOException
      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

      List<String> listFiles(String directoryPath) throws IOException
      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

      boolean exists(String relativePath)
      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

      default Path resolveAbsolutePath(String relativePath)
      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