org.wso2.carbon.registry.api.Resource.setContent()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(69)

本文整理了Java中org.wso2.carbon.registry.api.Resource.setContent方法的一些代码示例,展示了Resource.setContent的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.setContent方法的具体详情如下:
包路径:org.wso2.carbon.registry.api.Resource
类名称:Resource
方法名:setContent

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);

相关文章