Examples of DataHandler


Examples of javax.activation.DataHandler

        return p;
    }
   
    public DataHandler EchoPicture2(DataHandler handler)
    {
        return new DataHandler(GetPicture());
    }
View Full Code Here

Examples of javax.activation.DataHandler

        // Data Source
        DataSource source = new ByteArrayDataSource("tsztelak@gmail.com".getBytes(), "text/plain; charset=UTF-8");
        result = service.stringFromDataSource(source);
        System.out.print("Result : "+ result+"\n");
        // Data Handler
        result = service.stringFromDataHandler(new DataHandler(source));
        System.out.print("Result : "+ result+"\n");
        return ;
    }
View Full Code Here

Examples of javax.activation.DataHandler

            mimeBodyPart = new MimeBodyPart();
            FileDataSource fds = new FileDataSource(file);
            MimetypesFileTypeMap map = new MimetypesFileTypeMap();
            map.addMimeTypes(getTypeEntry(file));
            fds.setFileTypeMap(map);
            mimeBodyPart.setDataHandler(new DataHandler(fds));
            mimeBodyPart.setFileName(file.getName());
            mimeBodyPart.setDisposition(getDisposition(file));
            mimeMultipart.addBodyPart(mimeBodyPart);
          }
        }
View Full Code Here

Examples of javax.activation.DataHandler

        client.setProperty(HttpTransport.CHUNKING_ENABLED, new Boolean(chunking).toString());
       
        File f = getTestFile("src/test/org/codehaus/xfire/attachments/echo11.xml");
        FileDataSource fs = new FileDataSource(f);

        final DataHandler dh = new DataHandler(fs);
       
        client.addOutHandler(new AbstractHandler() {

            public void invoke(MessageContext context)
                throws Exception
View Full Code Here

Examples of javax.activation.DataHandler

            throws MessagingException
    {
        File f = getTestFile(name);
        FileDataSource fs = new FileDataSource(f);

        return new DataHandler(fs);
    }
View Full Code Here

Examples of javax.activation.DataHandler

            throws MessagingException
    {
        File f = getTestFile(name);
        FileDataSource fs = new FileDataSource(f);
       
        return new DataHandler(fs);
    }
View Full Code Here

Examples of javax.activation.DataHandler

        throws Exception
    {
        DataSource ds = new FileDataSource(
            getTestFile("src/test/org/codehaus/xfire/attachments/test.txt"));

        DataHandler handler = new DataHandler(ds);

        Object content = handler.getContent();
        assertNotNull(content);
        assertTrue("The content data type was not correctly detected. Check you computer/activation framework setup. "
                   + "Expected String but got: " + content.getClass(), content instanceof String);
        assertEquals("bleh", content);
    }
View Full Code Here

Examples of javax.activation.DataHandler

        StreamedAttachments atts = new StreamedAttachments(new FileInputStream(getTestFile("src/test/org/codehaus/xfire/attachments/mimedata")),
                                                           "multipart/related; type=\"application/xop+xml\"; start=\"<soap.xml@xfire.codehaus.org>\"; start-info=\"null; charset=utf-8\"; boundary=\"----=_Part_4_701508.1145579811786\"");
        Attachment soapMessage = atts.getSoapMessage();
        assertNotNull(soapMessage);
        assertEquals("text/xml", soapMessage.getHeader("Content-Type"));
        DataHandler handler = soapMessage.getDataHandler();
        assertNotNull(handler);
        assertNotNull(handler.getInputStream());
       
        Iterator parts = atts.getParts();
        assertTrue(parts.hasNext());

        Attachment a = (Attachment) parts.next();
View Full Code Here

Examples of javax.activation.DataHandler

    {
        StreamedAttachments atts = new StreamedAttachments(new FileInputStream(getTestFile("src/test/org/codehaus/xfire/attachments/mimedata2")),
                                                           "start=\"<soap.xml@xfire.codehaus.org>\"; boundary=----=_Part_0_1696092.1145592699395");
        Attachment soapMessage = atts.getSoapMessage();
        assertNotNull(soapMessage);
        DataHandler handler = soapMessage.getDataHandler();
        assertNotNull(handler);
        assertNotNull(handler.getInputStream());
       
        Iterator parts = atts.getParts();
        assertTrue(parts.hasNext());
   
        Attachment a = (Attachment) parts.next();
View Full Code Here

Examples of javax.activation.DataHandler

    {
        StreamedAttachments atts = new StreamedAttachments(new FileInputStream(getTestFile("src/test/org/codehaus/xfire/attachments/mimedata2")),
                                                           "multipart/related; type=\"application/xop+xml\"; start=\"<soap.xml@xfire.codehaus.org>\"; start-info=\"null; charset=utf-8\"; boundary=\"----=_Part_0_1696092.1145592699395\"");
        Attachment soapMessage = atts.getSoapMessage();
        assertNotNull(soapMessage);
        DataHandler handler = soapMessage.getDataHandler();
        assertNotNull(handler);
        assertNotNull(handler.getInputStream());
       
        Iterator parts = atts.getParts();
        assertTrue(parts.hasNext());
   
        Attachment a = (Attachment) parts.next();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.