本文整理了Java中org.wso2.carbon.registry.api.Resource.setContent
方法的一些代码示例,展示了Resource.setContent
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.setContent
方法的具体详情如下:
包路径:org.wso2.carbon.registry.api.Resource
类名称:Resource
方法名:setContent
暂无
代码示例来源:origin: wso2/carbon-identity-framework
@Override
public void persistConfig(String policyEditorType, String xmlConfig) throws PolicyEditorException {
super.persistConfig(policyEditorType, xmlConfig);
Registry registry = CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_GOVERNANCE);
try {
Resource resource = registry.newResource();
resource.setContent(xmlConfig);
String path = null;
if (EntitlementConstants.PolicyEditor.BASIC.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_BASIC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.STANDARD.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_STANDARD_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.RBAC.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_RBAC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.SET.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_SET_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else {
//default
path = EntitlementConstants.ENTITLEMENT_POLICY_BASIC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
}
registry.put(path, resource);
} catch (RegistryException e) {
throw new PolicyEditorException("Error while persisting policy editor config");
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.common
@Override
public void persistConfig(String policyEditorType, String xmlConfig) throws PolicyEditorException {
super.persistConfig(policyEditorType, xmlConfig);
Registry registry = CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_GOVERNANCE);
try {
Resource resource = registry.newResource();
resource.setContent(xmlConfig);
String path = null;
if (EntitlementConstants.PolicyEditor.BASIC.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_BASIC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.STANDARD.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_STANDARD_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.RBAC.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_RBAC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.SET.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_SET_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else {
//default
path = EntitlementConstants.ENTITLEMENT_POLICY_BASIC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
}
registry.put(path, resource);
} catch (RegistryException e) {
throw new PolicyEditorException("Error while persisting policy editor config");
}
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.entitlement.common
@Override
public void persistConfig(String policyEditorType, String xmlConfig) throws PolicyEditorException {
super.persistConfig(policyEditorType, xmlConfig);
Registry registry = CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_GOVERNANCE);
try {
Resource resource = registry.newResource();
resource.setContent(xmlConfig);
String path = null;
if (EntitlementConstants.PolicyEditor.BASIC.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_BASIC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.STANDARD.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_STANDARD_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.RBAC.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_RBAC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else if (EntitlementConstants.PolicyEditor.SET.equals(policyEditorType)) {
path = EntitlementConstants.ENTITLEMENT_POLICY_SET_EDITOR_CONFIG_FILE_REGISTRY_PATH;
} else {
//default
path = EntitlementConstants.ENTITLEMENT_POLICY_BASIC_EDITOR_CONFIG_FILE_REGISTRY_PATH;
}
registry.put(path, resource);
} catch (RegistryException e) {
throw new PolicyEditorException("Error while persisting policy editor config");
}
}
代码示例来源:origin: org.wso2.carbon.devicemgt-plugins/org.wso2.carbon.device.mgt.mobile.impl
resource.setContent(writer.toString());
resource.setMediaType(MobilePluginConstants.MEDIA_TYPE_XML);
MobileDeviceManagementUtil.putRegistryResource(resourcePath, resource);
代码示例来源:origin: org.wso2.carbon.devicemgt-plugins/org.wso2.carbon.device.mgt.mobile.impl
resource.setContent(writer.toString());
resource.setMediaType(MobilePluginConstants.MEDIA_TYPE_XML);
MobileDeviceManagementUtil.putRegistryResource(resourcePath, resource);
代码示例来源:origin: org.wso2.carbon.mediation/org.wso2.carbon.cloud.gateway
resource.setContent(wsdl);
dependencyResource.setContent(dependency.getContent());
registry.put(serviceResourcesPath + dependency.getKey(), dependencyResource);
内容来源于网络,如有侵权,请联系作者删除!