Search in sources :

Example 1 with ExtendedBaseRules

use of org.apache.commons.digester3.ExtendedBaseRules in project knox by apache.

the class XmlGatewayDescriptorImporter method load.

@Override
public GatewayDescriptor load(Reader reader) throws IOException {
    Digester digester = loader.newDigester(new ExtendedBaseRules());
    digester.setValidating(false);
    try {
        GatewayDescriptor descriptor = digester.parse(reader);
        return descriptor;
    } catch (SAXException e) {
        throw new IOException(e);
    }
}
Also used : ExtendedBaseRules(org.apache.commons.digester3.ExtendedBaseRules) GatewayDescriptor(org.apache.knox.gateway.descriptor.GatewayDescriptor) Digester(org.apache.commons.digester3.Digester) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException)

Example 2 with ExtendedBaseRules

use of org.apache.commons.digester3.ExtendedBaseRules in project knox by apache.

the class XmlUrlRewriteRulesImporter method load.

@Override
public UrlRewriteRulesDescriptor load(Reader reader) throws IOException {
    Digester digester = loader.newDigester(new ExtendedBaseRules());
    digester.setValidating(false);
    try {
        UrlRewriteRulesDescriptor rules = digester.parse(reader);
        return rules;
    } catch (SAXException e) {
        throw new IOException(e);
    }
}
Also used : ExtendedBaseRules(org.apache.commons.digester3.ExtendedBaseRules) Digester(org.apache.commons.digester3.Digester) UrlRewriteRulesDescriptor(org.apache.knox.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException)

Aggregations

IOException (java.io.IOException)2 Digester (org.apache.commons.digester3.Digester)2 ExtendedBaseRules (org.apache.commons.digester3.ExtendedBaseRules)2 SAXException (org.xml.sax.SAXException)2 GatewayDescriptor (org.apache.knox.gateway.descriptor.GatewayDescriptor)1 UrlRewriteRulesDescriptor (org.apache.knox.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor)1