Examples of FileDataSource


Examples of javax.activation.FileDataSource

          CvFileFacade cvfile  = new CvFileFacade();
          CvFileVO cvfilevo    = cvfile.getEmailAttachment(userId, Integer.parseInt(fileid), this.dataSource);

          String path          = cvfilevo.getPhysicalFolderVO().getFullPath(null, true) + cvfilevo.getName();

          DataSource source    = new FileDataSource(path);
          messageBodyPart.setDataHandler(new DataHandler(source));
          messageBodyPart.setFileName(name);
          multipart.addBodyPart(messageBodyPart);

        } //end of while loop(itt.hasNext())
View Full Code Here

Examples of javax.activation.FileDataSource

        assertNotNull(pbsource);
       
        InputStream is = pbsource.getInputStream();
        assertNotNull(is);
       
        FileDataSource fileSource = new FileDataSource(getTestFile("src/test-resources/xfire.jpg"));
        DataSource source2 = picClient.EchoPicture(fileSource);
        assertNotNull(source2);
       
        DataHandler handler = new DataHandler(source2);
        DataHandler handler2 = picClient.EchoPicture2(handler);
View Full Code Here

Examples of javax.activation.FileDataSource

        assertEquals(2, handlers.length);
    }

    private DataHandler createDataHandler()
    {
        FileDataSource fileSource = new FileDataSource(getTestFile("src/test-resources/xfire.jpg"));
        DataHandler handler = new DataHandler(fileSource);
        return handler;
    }
View Full Code Here

Examples of javax.activation.FileDataSource

public class PictureServiceImpl implements PictureService
{
    public DataSource GetPicture()
    {
        return new FileDataSource(getTestFile("src/test-resources/xfire.jpg"));
    }
View Full Code Here

Examples of javax.activation.FileDataSource

        Object obj = attachments.elementAt(i);
        if (obj instanceof File) {
          File file = (File)obj;
          if (file.isFile() && file.exists() && file.length() > 0) {
            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.FileDataSource

                                   "http://localhost:8191/AttachmentEcho");

        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() {
View Full Code Here

Examples of javax.activation.FileDataSource

    private final DataHandler createDataHandler(String name)
            throws MessagingException
    {
        File f = getTestFile(name);
        FileDataSource fs = new FileDataSource(f);

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

Examples of javax.activation.FileDataSource

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

Examples of javax.activation.FileDataSource


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

        DataHandler handler = new DataHandler(ds);

        Object content = handler.getContent();
View Full Code Here

Examples of javax.activation.FileDataSource

    }
   
    public void testImages()
        throws Exception
    {
        DataSource ds = new FileDataSource(
            getTestFile("src/test/org/codehaus/xfire/attachments/xfire_logo.jpg"));
   
        DefaultDataContentHandlerFactory factory = new DefaultDataContentHandlerFactory();

        Object content = factory.createDataContentHandler("image/jpeg").getContent(ds);
        assertNotNull(content);
        assertTrue(content instanceof java.awt.Image);
       
        ds = new FileDataSource(getTestFile("src/test/org/codehaus/xfire/attachments/fax.tif"));
        assertNotNull(ds);
       
        content = factory.createDataContentHandler("image/tiff").getContent(ds);
        assertNotNull(content);
        assertTrue("The content data type was not correctly detected. Check you computer/activation framework setup. "
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.