com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType Java Examples

The following examples show how to use com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType. 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: StringDataContentHandler.java    From TencentKona-8 with GNU General Public License v2.0 7 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #2
Source File: StringDataContentHandler.java    From jdk8u60 with GNU General Public License v2.0 7 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #3
Source File: MessageFactoryImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public SOAPMessage createMessage(MimeHeaders headers, XMLStreamReader reader) throws SOAPException, IOException {
    String contentTypeString = MessageImpl.getContentType(headers);

    if (listener != null) {
        throw new SOAPException("Listener OutputStream is not supported with XMLStreamReader");
    }

    try {
        ContentType contentType = new ContentType(contentTypeString);
        int stat = MessageImpl.identifyContentType(contentType);

        if (MessageImpl.isSoap1_1Content(stat)) {
            return new Message1_1Impl(headers,contentType,stat,reader);
        } else if (MessageImpl.isSoap1_2Content(stat)) {
            return new Message1_2Impl(headers,contentType,stat,reader);
        } else {
            log.severe("SAAJ0530.soap.unknown.Content-Type");
            throw new SOAPExceptionImpl("Unrecognized Content-Type");
        }
    } catch (ParseException e) {
        log.severe("SAAJ0531.soap.cannot.parse.Content-Type");
        throw new SOAPExceptionImpl(
            "Unable to parse content type: " + e.getMessage());
    }
}
 
Example #4
Source File: MultipartDataContentHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 */
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #5
Source File: MultipartDataContentHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 */
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #6
Source File: StringDataContentHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #7
Source File: StringDataContentHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #8
Source File: MultipartDataContentHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 *
 * @param ds The DataSource
 * @return content
 */
@Override
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #9
Source File: MultipartDataContentHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 */
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #10
Source File: StringDataContentHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #11
Source File: MultipartDataContentHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 */
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #12
Source File: StringDataContentHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #13
Source File: StringDataContentHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #14
Source File: MultipartDataContentHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 */
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #15
Source File: MultipartDataContentHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 */
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #16
Source File: MultipartDataContentHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the content.
 */
public Object getContent(DataSource ds) {
    try {
        return new MimeMultipart(
            ds, new ContentType(ds.getContentType()));
    } catch (Exception e) {
        return null;
    }
}
 
Example #17
Source File: StringDataContentHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private String getCharset(String type) {
    try {
        ContentType ct = new ContentType(type);
        String charset = ct.getParameter("charset");
        if (charset == null)
            // If the charset parameter is absent, use US-ASCII.
            charset = "us-ascii";
        return MimeUtility.javaCharset(charset);
    } catch (Exception ex) {
        return null;
    }
}
 
Example #18
Source File: Message1_2Impl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Message1_2Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #19
Source File: Message1_1Impl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #20
Source File: Message1_1Impl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #21
Source File: Message1_2Impl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Message1_2Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #22
Source File: Message1_1Impl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #23
Source File: Message1_2Impl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Message1_2Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #24
Source File: Message1_1Impl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #25
Source File: Message1_2Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Message1_2Impl(MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader)
        throws SOAPExceptionImpl {
        super(headers,ct,stat,reader);
}
 
Example #26
Source File: Message1_2Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Message1_2Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #27
Source File: Message1_1Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader)
        throws SOAPExceptionImpl {
        super(headers,ct,stat,reader);
}
 
Example #28
Source File: Message1_1Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #29
Source File: Message1_2Impl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Message1_2Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}
 
Example #30
Source File: Message1_1Impl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    throws SOAPExceptionImpl {
    super(headers,ct,stat,in);
}