Package javax.activation

Examples of javax.activation.URLDataSource


                                  String name,
                                  String description,
                                  String disposition)
        throws MessagingException
    {
        return attach( new URLDataSource(url), name, description, disposition );
    }
View Full Code Here


    return this;
  }
 
  @Override
  public TemplateMail embed(String name, URL url) {
    toEmbed.put(name, new URLDataSource(url));
    return this;
  }
View Full Code Here

    return this;
  }
 
  @Override
  public TemplateMail attach(String name, URL url) {
    toAttach.put(name, new URLDataSource(url));
    return this;
  }
View Full Code Here

        } catch (IllegalStateException e) {
            assertThat(e, exception("Attachment source already set: URL[", "testfile.txt]"));
        }

        try {
            content.setDataSource(new URLDataSource(u));
            fail();
        } catch (IllegalStateException e) {
            assertThat(e, exception("Attachment source already set: URL[", "testfile.txt]"));
        }
View Full Code Here

        }

        DataSource ds;

        try {
            ds = new URLDataSource(resource.getURL());
        } catch (IOException e) {
            ds = new ResourceDataSource(resource);
        }

        MimeBodyPart bodyPart = new MimeBodyPart();
View Full Code Here

            return url.toExternalForm();
        }

        @Override
        protected void render(Part mailPart, String fileName) {
            DataSource ds = new URLDataSource(url);

            if (fileName == null) {
                fileName = url.getPath();
            }
View Full Code Here

            }

            DataSource ds;

            try {
                ds = new URLDataSource(resource.getURL());
            } catch (IOException e) {
                ds = new ResourceDataSource(resource);
            }

            if (fileName == null) {
View Full Code Here

        DataSource ds;
        try {
            File f = new File(getClass().getResource("/log4j.properties").toURI());
            ds = new FileDataSource(f);
        } catch (URISyntaxException ex) {
            ds = new URLDataSource(getClass().getResource("/log4j.properties"));
        }
        DataHandler dh = new DataHandler(ds);

        BodyPart attachmentBodyPart;
        // Create another body part
View Full Code Here

        DataSource ds;
        try {
            File f = new File(getClass().getResource("/log4j.properties").toURI());
            ds = new FileDataSource(f);
        } catch (URISyntaxException ex) {
            ds = new URLDataSource(getClass().getResource("/log4j.properties"));
        }
        DataHandler dh = new DataHandler(ds);

        BodyPart attachmentBodyPart;
        // Create another body part
View Full Code Here

        exchange = new DefaultExchange(new DefaultCamelContext());
        exchange.setProperty("foo", 1234);
        Message message = exchange.getIn();
        message.setBody("<hello>world!</hello>");
        message.setHeader("bar", 567);
        message.addAttachment("att", new DataHandler(new URLDataSource(new URL("http://camel.apache.org/message.html"))));
    }
View Full Code Here

TOP

Related Classes of javax.activation.URLDataSource

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.