Class DirectoryFileResolver

Object
DirectoryFileResolver
All Implemented Interfaces:
FileResolver

public class DirectoryFileResolver extends Object implements FileResolver
Resolves file paths against a filesystem directory. Used when importing from a Git working tree.
  • Constructor Details

    • DirectoryFileResolver

      public DirectoryFileResolver(Path rootDir)
  • Method Details

    • resolve

      public InputStream resolve(String relativePath) throws IOException
      Description copied from interface: FileResolver
      Resolves a relative path to an input stream.
      Specified by:
      resolve in interface FileResolver
      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

      public List<String> listFiles(String directoryPath) throws IOException
      Description copied from interface: FileResolver
      Lists all files under a directory path. Used for library imports where the manifest points to a directory.
      Specified by:
      listFiles in interface FileResolver
      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

      public boolean exists(String relativePath)
      Description copied from interface: FileResolver
      Checks whether a file exists at the given relative path.
      Specified by:
      exists in interface FileResolver
      Parameters:
      relativePath - path relative to the content root
      Returns:
      true if the file exists and is readable
    • resolveAbsolutePath

      public Path resolveAbsolutePath(String relativePath)
      Description copied from interface: FileResolver
      Resolves a relative path to an absolute filesystem path. Used when a tool (e.g. Liquibase) needs direct filesystem access.
      Specified by:
      resolveAbsolutePath in interface FileResolver
      Returns:
      the absolute path, or null if this resolver is not filesystem-backed