Java Code Examples for com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException#getMessage()

The following examples show how to use com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException#getMessage() . 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: MimePartDataSource.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return decoded input stream
 */
@Override
public InputStream getInputStream() throws IOException {

    try {
        InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}
 
Example 2
Source File: MimePartDataSource.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return  decoded input stream
 */
public InputStream getInputStream() throws IOException {

    try {
    InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}
 
Example 3
Source File: MimePartDataSource.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return  decoded input stream
 */
public InputStream getInputStream() throws IOException {

    try {
    InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}
 
Example 4
Source File: MimePartDataSource.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return  decoded input stream
 */
public InputStream getInputStream() throws IOException {

    try {
    InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}
 
Example 5
Source File: MimePartDataSource.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return  decoded input stream
 */
public InputStream getInputStream() throws IOException {

    try {
    InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}
 
Example 6
Source File: MimePartDataSource.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return  decoded input stream
 */
public InputStream getInputStream() throws IOException {

    try {
    InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}
 
Example 7
Source File: MimePartDataSource.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return  decoded input stream
 */
public InputStream getInputStream() throws IOException {

    try {
    InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}
 
Example 8
Source File: MimePartDataSource.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns an input stream from this  MimeBodyPart. <p>
 *
 * This method applies the appropriate transfer-decoding, based
 * on the Content-Transfer-Encoding attribute of this MimeBodyPart.
 * Thus the returned input stream is a decoded stream of bytes.<p>
 *
 * This implementation obtains the raw content from the MimeBodyPart
 * using the <code>getContentStream()</code> method and decodes
 * it using the <code>MimeUtility.decode()</code> method.
 *
 * @return  decoded input stream
 */
public InputStream getInputStream() throws IOException {

    try {
    InputStream is = part.getContentStream();

        String encoding = part.getEncoding();
        if (encoding != null)
            return MimeUtility.decode(is, encoding);
        else
            return is;
    } catch (MessagingException mex) {
        throw new IOException(mex.getMessage());
    }
}