com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility Java Examples
The following examples show how to use
com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility.
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 |
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 |
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: AttachmentPartImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void setBase64Content(InputStream content, String contentType) throws SOAPException { if (mimePart != null) { mimePart.close(); mimePart = null; } dataHandler = null; InputStream decoded = null; try { decoded = MimeUtility.decode(content, "base64"); InternetHeaders hdrs = new InternetHeaders(); hdrs.setHeader("Content-Type", contentType); //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart // Ctor with inputStream causes problems based on the InputStream // has markSupported()==true ByteOutputStream bos = new ByteOutputStream(); bos.write(decoded); rawContent = new MimeBodyPart(hdrs, bos.getBytes(), bos.getCount()); setMimeHeader("Content-Type", contentType); } catch (Exception e) { log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e); throw new SOAPExceptionImpl(e.getLocalizedMessage()); } finally { try { decoded.close(); } catch (IOException ex) { throw new SOAPException(ex); } } }
Example #4
Source File: AttachmentPartImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void setBase64Content(InputStream content, String contentType) throws SOAPException { if (mimePart != null) { mimePart.close(); mimePart = null; } dataHandler = null; InputStream decoded = null; try { decoded = MimeUtility.decode(content, "base64"); InternetHeaders hdrs = new InternetHeaders(); hdrs.setHeader("Content-Type", contentType); //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart // Ctor with inputStream causes problems based on the InputStream // has markSupported()==true ByteOutputStream bos = new ByteOutputStream(); bos.write(decoded); rawContent = new MimeBodyPart(hdrs, bos.getBytes(), bos.getCount()); setMimeHeader("Content-Type", contentType); } catch (Exception e) { log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e); throw new SOAPExceptionImpl(e.getLocalizedMessage()); } finally { try { decoded.close(); } catch (IOException ex) { throw new SOAPException(ex); } } }
Example #5
Source File: AttachmentPartImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void setBase64Content(InputStream content, String contentType) throws SOAPException { if (mimePart != null) { mimePart.close(); mimePart = null; } dataHandler = null; InputStream decoded = null; try { decoded = MimeUtility.decode(content, "base64"); InternetHeaders hdrs = new InternetHeaders(); hdrs.setHeader("Content-Type", contentType); //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart // Ctor with inputStream causes problems based on the InputStream // has markSupported()==true ByteOutputStream bos = new ByteOutputStream(); bos.write(decoded); rawContent = new MimeBodyPart(hdrs, bos.getBytes(), bos.getCount()); setMimeHeader("Content-Type", contentType); } catch (Exception e) { log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e); throw new SOAPExceptionImpl(e.getLocalizedMessage()); } finally { try { decoded.close(); } catch (IOException ex) { throw new SOAPException(ex); } } }
Example #6
Source File: StringDataContentHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
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: AttachmentPartImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void setBase64Content(InputStream content, String contentType) throws SOAPException { if (mimePart != null) { mimePart.close(); mimePart = null; } dataHandler = null; InputStream decoded = null; try { decoded = MimeUtility.decode(content, "base64"); InternetHeaders hdrs = new InternetHeaders(); hdrs.setHeader("Content-Type", contentType); //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart // Ctor with inputStream causes problems based on the InputStream // has markSupported()==true ByteOutputStream bos = new ByteOutputStream(); bos.write(decoded); rawContent = new MimeBodyPart(hdrs, bos.getBytes(), bos.getCount()); setMimeHeader("Content-Type", contentType); } catch (Exception e) { log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e); throw new SOAPExceptionImpl(e.getLocalizedMessage()); } finally { try { decoded.close(); } catch (IOException ex) { throw new SOAPException(ex); } } }
Example #8
Source File: StringDataContentHandler.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
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 #9
Source File: StringDataContentHandler.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
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 #10
Source File: AttachmentPartImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
public void setBase64Content(InputStream content, String contentType) throws SOAPException { if (mimePart != null) { mimePart.close(); mimePart = null; } dataHandler = null; InputStream decoded = null; try { decoded = MimeUtility.decode(content, "base64"); InternetHeaders hdrs = new InternetHeaders(); hdrs.setHeader("Content-Type", contentType); //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart // Ctor with inputStream causes problems based on the InputStream // has markSupported()==true ByteOutputStream bos = new ByteOutputStream(); bos.write(decoded); rawContent = new MimeBodyPart(hdrs, bos.getBytes(), bos.getCount()); setMimeHeader("Content-Type", contentType); } catch (Exception e) { log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e); throw new SOAPExceptionImpl(e.getLocalizedMessage()); } finally { try { decoded.close(); } catch (IOException ex) { throw new SOAPException(ex); } } }
Example #11
Source File: StringDataContentHandler.java From hottub with GNU General Public License v2.0 | 5 votes |
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 #12
Source File: AttachmentPartImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void setBase64Content(InputStream content, String contentType) throws SOAPException { if (mimePart != null) { mimePart.close(); mimePart = null; } dataHandler = null; InputStream decoded = null; try { decoded = MimeUtility.decode(content, "base64"); InternetHeaders hdrs = new InternetHeaders(); hdrs.setHeader("Content-Type", contentType); //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart // Ctor with inputStream causes problems based on the InputStream // has markSupported()==true ByteOutputStream bos = new ByteOutputStream(); bos.write(decoded); rawContent = new MimeBodyPart(hdrs, bos.getBytes(), bos.getCount()); setMimeHeader("Content-Type", contentType); } catch (Exception e) { log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e); throw new SOAPExceptionImpl(e.getLocalizedMessage()); } finally { try { decoded.close(); } catch (IOException ex) { throw new SOAPException(ex); } } }
Example #13
Source File: StringDataContentHandler.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
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: AttachmentPartImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void setBase64Content(InputStream content, String contentType) throws SOAPException { if (mimePart != null) { mimePart.close(); mimePart = null; } dataHandler = null; InputStream decoded = null; try { decoded = MimeUtility.decode(content, "base64"); InternetHeaders hdrs = new InternetHeaders(); hdrs.setHeader("Content-Type", contentType); //TODO: reading the entire attachment here is ineffcient. Somehow the MimeBodyPart // Ctor with inputStream causes problems based on the InputStream // has markSupported()==true ByteOutputStream bos = new ByteOutputStream(); bos.write(decoded); rawContent = new MimeBodyPart(hdrs, bos.getBytes(), bos.getCount()); setMimeHeader("Content-Type", contentType); } catch (Exception e) { log.log(Level.SEVERE, "SAAJ0578.soap.attachment.setbase64content.exception", e); throw new SOAPExceptionImpl(e.getLocalizedMessage()); } finally { try { decoded.close(); } catch (IOException ex) { throw new SOAPException(ex); } } }
Example #15
Source File: StringDataContentHandler.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
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; } }