<%@ page import="org.wso2.carbon.context.CarbonContext" %> <%@ page import="org.wso2.carbon.context.RegistryType" %> <%@ page import="org.wso2.carbon.registry.core.Registry" %> <%@ page import="org.wso2.carbon.registry.core.Resource" %> <%@ page import="org.apache.commons.lang.StringUtils" %> <%@ page import="org.apache.commons.httpclient.HttpClient" %> <%@ page import="org.apache.commons.httpclient.HttpStatus" %> <%@ page import="org.apache.commons.httpclient.methods.GetMethod" %> <%@ page import="org.wso2.carbon.registry.core.exceptions.RegistryException" %> <%@ page import="org.wso2.carbon.registry.core.utils.RegistryUtils" %> <%@ page import="org.wso2.carbon.registry.core.RegistryConstants" %> <% String appKey = request.getParameter("appKey"); String propName = request.getParameter("propName"); String propValue = ""; if (appKey != null && appKey != "") { String resourcePath = "/dependencies/" + appKey + "/" + propName; CarbonContext cCtx = CarbonContext.getThreadLocalCarbonContext(); Registry registry = (Registry) cCtx.getRegistry(RegistryType.SYSTEM_GOVERNANCE); try { if (registry.resourceExists(resourcePath)) { Resource resource = registry.get(resourcePath); if (resource.getContent() != null) { if (resource.getContent() instanceof String) { propValue = (String) resource.getContent(); } else if (resource.getContent() instanceof byte[]) { propValue = new String((byte[]) resource.getContent()); } } } else { propValue = propName + " property doesn't exists"; } } catch (RegistryException e) { propValue = "Unable to read the resource content"; } } else { appKey = ""; propName = ""; } %> Insert title here

End Points and Registry Sample


Application key :

Property Name :

<%=propValue%>