Search in sources :

Example 6 with ParserConfigurator

use of org.codice.ddf.parser.ParserConfigurator in project ddf by codice.

the class GeometryTransformer method transform.

public BinaryContent transform(Attribute attribute) throws CatalogTransformerException {
    ParserConfigurator parserConfigurator = getParserConfigurator().setHandler(new DefaultValidationEventHandler());
    try {
        ByteArrayOutputStream os = new ByteArrayOutputStream(BUFFER_SIZE);
        getParser().marshal(parserConfigurator, GeometryAdapter.marshalFrom(attribute), os);
        ByteArrayInputStream bais = new ByteArrayInputStream(os.toByteArray());
        return new BinaryContentImpl(bais, MIME_TYPE);
    } catch (ParserException e) {
        throw new CatalogTransformerException("Failed to marshall geometry data", e);
    }
}
Also used : ParserConfigurator(org.codice.ddf.parser.ParserConfigurator) ParserException(org.codice.ddf.parser.ParserException) ByteArrayInputStream(java.io.ByteArrayInputStream) CatalogTransformerException(ddf.catalog.transform.CatalogTransformerException) ByteArrayOutputStream(java.io.ByteArrayOutputStream) BinaryContentImpl(ddf.catalog.data.impl.BinaryContentImpl) DefaultValidationEventHandler(javax.xml.bind.helpers.DefaultValidationEventHandler)

Aggregations

ParserConfigurator (org.codice.ddf.parser.ParserConfigurator)6 ParserException (org.codice.ddf.parser.ParserException)6 ArrayList (java.util.ArrayList)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 JAXBElement (javax.xml.bind.JAXBElement)3 UsernameTokenType (org.apache.cxf.ws.security.sts.provider.model.secext.UsernameTokenType)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 Principal (java.security.Principal)2 Map (java.util.Map)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 CallbackHandler (javax.security.auth.callback.CallbackHandler)2 STSPropertiesMBean (org.apache.cxf.sts.STSPropertiesMBean)2 ReceivedToken (org.apache.cxf.sts.request.ReceivedToken)2 TokenValidator (org.apache.cxf.sts.token.validator.TokenValidator)2 TokenValidatorResponse (org.apache.cxf.sts.token.validator.TokenValidatorResponse)2 AttributedString (org.apache.cxf.ws.security.sts.provider.model.secext.AttributedString)2 PasswordString (org.apache.cxf.ws.security.sts.provider.model.secext.PasswordString)2 BSPEnforcer (org.apache.wss4j.common.bsp.BSPEnforcer)2 Crypto (org.apache.wss4j.common.crypto.Crypto)2 WSSecurityException (org.apache.wss4j.common.ext.WSSecurityException)2