Interface ResourceReader


public interface ResourceReader
Provides read access to a .gwex ZIP file during import. Passed to ImportExportDelegate.parseImport(List, ResourceReader), ImportExportDelegate.prepareImport(List, ImportContext, ResourceReader), and ImportExportDelegate.afterImport(List, ImportContext, ResourceReader) so delegates can read resource files and additional associated data. Path namespacing is handled automatically.
  • Method Details

    • readResource

      Resource readResource(ResourcePath resourcePath, String collection) throws IOException, ResourceReader.ImportExportResourceException
      Read the standard resource files for a resource from the .gwex and reconstruct the Resource object.

      Reads from config/resources/{collection}/... in the ZIP.

      Parameters:
      resourcePath - the logical resource path
      collection - the collection the resource belongs to
      Returns:
      the reconstructed resource
      Throws:
      IOException
      ResourceReader.ImportExportResourceException
    • readAdditionalData

      Optional<InputStream> readAdditionalData(String entryName) throws IOException
      Read a named additional data entry for this resource type as a streaming InputStream. The entry is scoped to the delegate's resource type namespace ( content/{moduleId}/{typeId}/) automatically.

      The caller is responsible for closing the returned stream.

      Parameters:
      entryName - the entry name, may include sub-paths (e.g., "tag-values.json" or "provider-default/values.json")
      Returns:
      an input stream for the entry's content, or empty if not present
      Throws:
      IOException