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 TypeMethodDescriptionvoidwriteAdditionalData(String entryName, InputStream data) Write a named additional data entry for this resource type.voidwriteResourceFiles(Resource resource, String collection) Write the standard resource files (config.json, resource.json, and any data files) for the given resource into the.gwexZIP.
-
Method Details
-
writeResourceFiles
Write the standard resource files (config.json, resource.json, and any data files) for the given resource into the.gwexZIP.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 writtencollection- the collection the resource belongs to- Throws:
IOException
-
writeAdditionalData
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
-