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.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class -
Method Summary
Modifier and TypeMethodDescriptionreadAdditionalData(String entryName) Read a named additional data entry for this resource type as a streamingInputStream.readResource(ResourcePath resourcePath, String collection) Read the standard resource files for a resource from the.gwexand reconstruct theResourceobject.
-
Method Details
-
readResource
Resource readResource(ResourcePath resourcePath, String collection) throws IOException, ResourceReader.ImportExportResourceException Read the standard resource files for a resource from the.gwexand reconstruct theResourceobject.Reads from
config/resources/{collection}/...in the ZIP.- Parameters:
resourcePath- the logical resource pathcollection- the collection the resource belongs to- Returns:
- the reconstructed resource
- Throws:
IOExceptionResourceReader.ImportExportResourceException
-
readAdditionalData
Read a named additional data entry for this resource type as a streamingInputStream. 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
-