Interface ResourceWriter


public interface ResourceWriter
Provides write access to a .gwex ZIP file during export. Passed to ImportExportDelegate.onExport(List, ResourceWriter) so delegates can write resource files and additional associated data. Path namespacing is handled automatically.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Write a named additional data entry for this resource type.
    void
    writeResourceFiles(Resource resource, String collection)
    Write the standard resource files (config.json, resource.json, and any data files) for the given resource into the .gwex ZIP.
  • Method Details

    • writeResourceFiles

      void writeResourceFiles(Resource resource, String collection) throws IOException
      Write the standard resource files (config.json, resource.json, and any data files) for the given resource into the .gwex ZIP.

      Files are written under config/resources/{collection}/... in the ZIP, mirroring the on-disk resource directory layout.

      Parameters:
      resource - the resource whose files should be written
      collection - the collection the resource belongs to
      Throws:
      IOException
    • writeAdditionalData

      void writeAdditionalData(String entryName, InputStream data) throws IOException
      Write a named additional data entry for this resource type. Used by delegates that need to contribute extra data beyond the standard resource files. The entry is scoped to the delegate's resource type namespace (content/{moduleId}/{typeId}/) automatically.

      The delegate controls the internal structure — it can write one file for all resources of the type or use sub-paths to organize per-provider, per-collection, etc.

      The stream is read to completion but NOT closed by this method — the caller owns the stream lifecycle.

      Parameters:
      entryName - the entry name, may include sub-paths (e.g., "tag-values.json" or "provider-default/values.json")
      data - the input stream to read from
      Throws:
      IOException