Class DirectoryTemplateSource

java.lang.Object
network.ike.plugin.scaffold.DirectoryTemplateSource
All Implemented Interfaces:
TemplateSource

public final class DirectoryTemplateSource extends Object implements TemplateSource
Template source backed by an unpacked directory.

In production the ike-build-standards scaffold is unpacked to a directory during plugin validate; this class resolves source paths against that directory.

  • Constructor Details

    • DirectoryTemplateSource

      public DirectoryTemplateSource(Path root)
      Construct a source rooted at the given unpacked scaffold directory. Template source paths are resolved as children of this root, with a guard that rejects any path that escapes it.
      Parameters:
      root - directory containing the scaffold templates
  • Method Details

    • read

      public byte[] read(String source)
      Description copied from interface: TemplateSource
      Read template bytes for a given source path.
      Specified by:
      read in interface TemplateSource
      Parameters:
      source - the path declared in the manifest's source field
      Returns:
      the template bytes