From f57c1e0f4675f47caf5a7a632bc322d0ae0bf49c Mon Sep 17 00:00:00 2001 From: chathurangaj Date: Thu, 19 Dec 2024 00:25:50 +0530 Subject: [PATCH] handle resource key while resolving registry URI --- .../micro/integrator/registry/MicroIntegratorRegistry.java | 4 ++++ .../integrator/registry/MicroIntegratorRegistryConstants.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java b/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java index 2588a58e70..5d11cfeb67 100644 --- a/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java +++ b/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistry.java @@ -1035,6 +1035,10 @@ private String resolveRegistryURI(String key) { registryRoot = localRegistry; resourcePath = key.substring(MicroIntegratorRegistryConstants.LOCAL_REGISTRY_PREFIX.length()); + } else if (key.startsWith(MicroIntegratorRegistryConstants.RESOURCES_PREFIX)) { + registryRoot = govRegistry; + resourcePath = MicroIntegratorRegistryConstants.MI_RESOURCES_DIRECTORY_NAME + URL_SEPARATOR + + key.substring(MicroIntegratorRegistryConstants.RESOURCES_PREFIX.length()); } else { registryRoot = govRegistry; resourcePath = key; diff --git a/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistryConstants.java b/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistryConstants.java index 74437ab18c..911d5017ac 100644 --- a/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistryConstants.java +++ b/components/mediation/registry/org.wso2.micro.integrator.registry/src/main/java/org/wso2/micro/integrator/registry/MicroIntegratorRegistryConstants.java @@ -45,11 +45,12 @@ public class MicroIntegratorRegistryConstants { public static final String PROTOCOL_HTTPS = "https"; public static final String FILE_PROTOCOL_PREFIX = "file:"; - + public static final String RESOURCES_PREFIX = "resources:"; public static final String CONFIG_REGISTRY_PREFIX = "conf:"; public static final String GOVERNANCE_REGISTRY_PREFIX = "gov:"; public static final String LOCAL_REGISTRY_PREFIX = "local:"; + public static final String MI_RESOURCES_DIRECTORY_NAME = "mi-resources"; public static final String CONFIG_DIRECTORY_NAME = "config"; public static final String GOVERNANCE_DIRECTORY_NAME = "governance"; public static final String LOCAL_DIRECTORY_NAME = "local";