Package org.apache.synapse.util

Examples of org.apache.synapse.util.SynapseBinaryDataSource


            Parameter synEnv = messageContext.getConfigurationContext()
                    .getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_ENV);

            DataHandler dataHandler;
            if (synEnv != null && synEnv.getValue() != null) {
                dataHandler = new DataHandler(new SynapseBinaryDataSource(
                        inputStream, contentType, (SynapseEnvironment) synEnv.getValue()));
            } else {
                // add Hessian data inside a data handler
                dataHandler = new DataHandler(
                        new SynapseBinaryDataSource(inputStream,contentType));
            }
            OMText textData = factory.createOMText(dataHandler, true);
            element.addChild(textData);

        } catch (IOException e) {
View Full Code Here


            if (hessianOMText != null) {

                try {

                    SynapseBinaryDataSource synapseBinaryDataSource = (SynapseBinaryDataSource) (
                            (DataHandler) hessianOMText.getDataHandler()).getDataSource();

                    InputStream inputStream = synapseBinaryDataSource.getInputStream();
                    BufferedOutputStream outputStream = new BufferedOutputStream(out);

                    byte[] buffer = new byte[1024];
                    int byteCount;
                    while ((byteCount=inputStream.read(buffer)) != -1) {
View Full Code Here

            BufferedInputStream newInputStream = new BufferedInputStream(
                    newConnection.getInputStream());

            OMFactory omFactory = OMAbstractFactory.getOMFactory();
            return omFactory.createOMText(
                    new DataHandler(new SynapseBinaryDataSource(newInputStream,
                            newConnection.getContentType())), true);

        } catch (IOException e) {
            handleException("Error when getting a stream from resource's content", e);
        }
View Full Code Here

TOP

Related Classes of org.apache.synapse.util.SynapseBinaryDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.