Java Code Examples for javax.activation.DataHandler#getDataSource()

The following examples show how to use javax.activation.DataHandler#getDataSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MimeMessageParser.java    From commons-email with Apache License 2.0 5 votes vote down vote up
/**
 * Parses the MimePart to create a DataSource.
 *
 * @param parent the parent multi-part
 * @param part   the current part to be processed
 * @return the DataSource
 * @throws MessagingException creating the DataSource failed
 * @throws IOException        creating the DataSource failed
 */
protected DataSource createDataSource(final Multipart parent, final MimePart part)
    throws MessagingException, IOException
{
    final DataHandler dataHandler = part.getDataHandler();
    final DataSource dataSource = dataHandler.getDataSource();
    final String contentType = getBaseMimeType(dataSource.getContentType());
    final byte[] content = this.getContent(dataSource.getInputStream());
    final ByteArrayDataSource result = new ByteArrayDataSource(content, contentType);
    final String dataSourceName = getDataSourceName(part, dataSource);

    result.setName(dataSourceName);
    return result;
}
 
Example 2
Source File: Base64Data.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 3
Source File: DataSourceSource.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}
 
Example 4
Source File: Base64Data.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 5
Source File: DataSourceSource.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}
 
Example 6
Source File: Base64Data.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 7
Source File: DataSourceSource.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}
 
Example 8
Source File: Base64Data.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 9
Source File: DataSourceSource.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}
 
Example 10
Source File: Base64Data.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 11
Source File: DataSourceSource.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}
 
Example 12
Source File: Base64Data.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 13
Source File: DataSourceSource.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}
 
Example 14
Source File: Base64Data.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 15
Source File: DataSourceSource.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}
 
Example 16
Source File: Base64Data.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
FilterDataHandler(DataHandler dh) {
    super(dh.getDataSource());
}
 
Example 17
Source File: DataSourceSource.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public DataSourceSource(DataHandler dh) throws MimeTypeParseException {
    this(dh.getDataSource());
}