Search in sources :

Example 1 with STSConfigParser

use of org.picketlink.config.federation.parsers.STSConfigParser in project wildfly by wildfly.

the class EntityProviderService method createSTSType.

private STSType createSTSType() {
    STSType stsType = null;
    InputStream stream = null;
    try {
        URL url = getClass().getClassLoader().getResource("core-sts.xml");
        if (url == null) {
            url = Thread.currentThread().getContextClassLoader().getResource("core-sts");
        }
        if (url != null) {
            stream = url.openStream();
            stsType = (STSType) new STSConfigParser().parse(stream);
        }
    } catch (Exception e) {
        throw PicketLinkLogger.ROOT_LOGGER.federationCouldNotParseSTSConfig(e);
    } finally {
        try {
            if (stream != null) {
                stream.close();
            }
        } catch (IOException ignored) {
        }
    }
    return stsType;
}
Also used : InputStream(java.io.InputStream) STSType(org.picketlink.config.federation.STSType) IOException(java.io.IOException) URL(java.net.URL) ConfigurationException(org.picketlink.common.exceptions.ConfigurationException) StartException(org.jboss.msc.service.StartException) IOException(java.io.IOException) STSConfigParser(org.picketlink.config.federation.parsers.STSConfigParser)

Aggregations

IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1 StartException (org.jboss.msc.service.StartException)1 ConfigurationException (org.picketlink.common.exceptions.ConfigurationException)1 STSType (org.picketlink.config.federation.STSType)1 STSConfigParser (org.picketlink.config.federation.parsers.STSConfigParser)1