Package org.apache.commons.mail

Examples of org.apache.commons.mail.ByteArrayDataSource


      else
      {
        // Normal Content
        final ByteArrayInputStream bin = new ByteArrayInputStream(data);
        final String contentId = (String) item.getContentId();
        final ByteArrayDataSource dataSource = new ByteArrayDataSource(bin, item.getMimeType());
        repository.getHtmlEmail().embed(dataSource, contentId, contentId);
        bin.close();

      }
    }
View Full Code Here


                String resourceName = getResourceName(resourceLocation);
                InputStream is = DataSourceClassPathResolver.class.getResourceAsStream(resourceName);

                if (is != null)
                {
                    ByteArrayDataSource ds = new ByteArrayDataSource(is, mimeType);
                    // EMAIL-125: set the name of the DataSource to the normalized resource URL
                    // similar to other DataSource implementations, e.g. FileDataSource, URLDataSource
                    ds.setName(DataSourceClassPathResolver.class.getResource(resourceName).toString());
                    result = ds;
                }
                else
                {
                    if (isLenient)
View Full Code Here

                String resourceName = getResourceName(resourceLocation);
                InputStream is = DataSourceClassPathResolver.class.getResourceAsStream(resourceName);

                if (is != null)
                {
                    result = new ByteArrayDataSource(is, mimeType);
                }
                else
                {
                    if (isLenient)
                    {
View Full Code Here

TOP

Related Classes of org.apache.commons.mail.ByteArrayDataSource

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.