WebserviceSAMLSPTestSetup.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:oscm 作者:
private void setJKSLocation(String domainPath) {
    URL fileUrl = Thread.currentThread().getContextClassLoader()
            .getResource(STSConfigTemplateFileName);

    File file = new File(fileUrl.getFile());
    if (!file.exists()) {
        System.out.println("MockSTSServiceTemplate.xml not exists");
        return;
    }
    try {
        Document doc = parse(file);
        XPathFactory xpfactory = XPathFactory.newInstance();
        XPath path = xpfactory.newXPath();
        updateElementValue(path, doc,
                "/definitions/Policy/ExactlyOne/All/KeyStore", "location",
                domainPath + "/config/keystore.jks");
        updateElementValue(path, doc,
                "/definitions/Policy/ExactlyOne/All/TrustStore",
                "location", domainPath + "/config/cacerts.jks");
        doc2Xml(doc);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号