public URLRuleModel translateUrlRules(URLRules source, NamespacedListRepository namespacedLists) {
String urlRulesXML = getUrlRulesXML(source);
URLRuleModel model = null;
try {
if (StringUtils.isNotBlank(urlRulesXML)) {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document newDocument = builder.parse(new ByteArrayInputStream(urlRulesXML.getBytes(UTF8_CHARSET)));
model = new URLRuleModel(newDocument, namespacedLists);
log.info("Rules created from xml: \n{}", urlRulesXML);
} else {
log.error("Trying to init null model");
}
} catch (Exception ex) {
log.error("Exception while creating model from xml: \n{}Root cause: {}", urlRulesXML, ex.getCause().getMessage());
}
return model;
}
ModelTranslationService.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:redirector
作者:
评论列表
文章目录