Package org.apache.servicemix.jbi.util

Examples of org.apache.servicemix.jbi.util.StreamDataSource


        this.contentType = contentType;
    }

    public void readMessage(MessageExchange exchange, NormalizedMessage message,
                            InputStream in, String path) throws IOException, JBIException {
        DataSource ds = new StreamDataSource(in, contentType);
        DataHandler handler = new DataHandler(ds);
        message.addAttachment(attachment, handler);
        message.setProperty(FILE_NAME_PROPERTY, new File(path).getName());
        message.setProperty(FILE_PATH_PROPERTY, path);
    }
View Full Code Here


  public void setContentType(String contentType) {
    this.contentType = contentType;
  }

    public void readMessage(MessageExchange exchange, NormalizedMessage message, InputStream in, String path) throws IOException, JBIException {
      DataSource ds = new StreamDataSource(in, contentType);
      DataHandler handler = new DataHandler(ds);
      message.addAttachment(attachment, handler);
        message.setProperty(FILE_NAME_PROPERTY, new File(path).getName());
        message.setProperty(FILE_PATH_PROPERTY, path);
    }
View Full Code Here

        me.setOperation(new QName("uri", "op"));
        me.setProperty("myProp", "myValue");
        NormalizedMessage msg = me.createMessage();
        msg.setProperty("myMsgProp", "myMsgValue");
        msg.setContent(src);
        msg.addAttachment("myAttachment", new DataHandler(new StreamDataSource(new ByteArrayInputStream("hello".getBytes()))));
        me.setMessage(msg, "in");
        assertNotNull(((NormalizedMessageImpl) msg).getBody());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
View Full Code Here

        me.setOperation(new QName("uri", "op"));
        me.setProperty("myProp", "myValue");
        NormalizedMessage msg = me.createMessage();
        msg.setProperty("myMsgProp", "myMsgValue");
        msg.setContent(src);
        msg.addAttachment("myAttachment", new DataHandler(new StreamDataSource(new ByteArrayInputStream("hello".getBytes()))));
        me.setMessage(msg, "in");
        assertNotNull(((NormalizedMessageImpl) msg).getBody());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
View Full Code Here

  public void setContentType(String contentType) {
    this.contentType = contentType;
  }

    public void readMessage(MessageExchange exchange, NormalizedMessage message, InputStream in, String path) throws IOException, JBIException {
      DataSource ds = new StreamDataSource(in, contentType);
      DataHandler handler = new DataHandler(ds);
      message.addAttachment(attachment, handler);
        message.setProperty(FILE_NAME_PROPERTY, new File(path).getName());
        message.setProperty(FILE_PATH_PROPERTY, path);
    }
View Full Code Here

        me.setOperation(new QName("uri", "op"));
        me.setProperty("myProp", "myValue");
        NormalizedMessage msg = me.createMessage();
        msg.setProperty("myMsgProp", "myMsgValue");
        msg.setContent(src);
        msg.addAttachment("myAttachment", new DataHandler(new StreamDataSource(new ByteArrayInputStream("hello".getBytes()))));
        me.setMessage(msg, "in");
        assertNotNull(((NormalizedMessageImpl) msg).getBody());
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.util.StreamDataSource

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.