String filename = cd.getParameter("filename"); if (filename != null) { ParameterList p = cType.getParameterList(); if (p == null) { p = new ParameterList();
String filename = cd.getParameter("filename"); if (filename != null) { ParameterList p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();
public static ContentType removeCharset(ContentType contentType) { ParameterList orgParamList = contentType.getParameterList(); ParameterList paramList = new ParameterList(); for (Enumeration<?> e = orgParamList.getNames(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); if (!name.equalsIgnoreCase("charset")) { paramList.set(name, orgParamList.get(name)); } } return new ContentType(contentType.getPrimaryType(), contentType.getSubType(), paramList); } }
public static ContentType removeCharset(ContentType contentType) { ParameterList orgParamList = contentType.getParameterList(); ParameterList paramList = new ParameterList(); for (Enumeration<?> e = orgParamList.getNames(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); if (!name.equalsIgnoreCase("charset")) { paramList.set(name, orgParamList.get(name)); } } return new ContentType(contentType.getPrimaryType(), contentType.getSubType(), paramList); } }
public static ContentType addCharset(ContentType contentType, String charset) { ParameterList orgParamList = contentType.getParameterList(); ParameterList paramList = new ParameterList(); if (orgParamList != null) { for (Enumeration<?> e = orgParamList.getNames(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); paramList.set(name, orgParamList.get(name)); } } paramList.set("charset", charset); return new ContentType(contentType.getPrimaryType(), contentType.getSubType(), paramList); }
/** * If the message is <code>format=flowed</code> * set the encoded version as message content. */ public static void deflowMessage(Message m) throws MessagingException, IOException { ContentType ct = new ContentType(m.getContentType()); String format = ct.getParameter("format"); if (ct.getBaseType().equals("text/plain") && format != null && format.equalsIgnoreCase("flowed")) { String delSp = ct.getParameter("delsp"); String deflowed = deflow((String) m.getContent(), delSp != null && delSp.equalsIgnoreCase("yes")); ct.getParameterList().remove("format"); ct.getParameterList().remove("delsp"); if (ct.toString().contains("flowed")) { LOGGER.error("FlowedMessageUtils dind't remove the flowed correctly"); } m.setContent(deflowed, ct.toString()); m.saveChanges(); } }
public static ContentType addCharset(ContentType contentType, String charset) { ParameterList orgParamList = contentType.getParameterList(); ParameterList paramList = new ParameterList(); if (orgParamList != null) { for (Enumeration<?> e = orgParamList.getNames(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); paramList.set(name, orgParamList.get(name)); } } paramList.set("charset", charset); return new ContentType(contentType.getPrimaryType(), contentType.getSubType(), paramList); }
String encoding = contentType.getParameterList().get("charset"); if (encoding != null)
private void updateContentType(boolean cleanDefaultRoot) throws MessagingException { BodyPart part = null; if (rootId == null) { part = getBodyPart(0); } else { part = getBodyPart(rootId); if (part == null) { if (cleanDefaultRoot) rootId = null; else throw new MessagingException("Can not set root: " + rootId + ": not found"); } } if (part != null) { String primaryType = baseContentTypeObject.getPrimaryType(); String subType = baseContentTypeObject.getSubType(); ParameterList params = baseContentTypeObject.getParameterList(); ContentType newContentType = new ContentType(primaryType, subType, params); ContentType rootContentType = new ContentType(part.getDataHandler().getContentType()); newContentType.setParameter("type", rootContentType.getBaseType()); if (rootId != null) newContentType.setParameter("start", rootId); contentType = newContentType.toString(); } }
private void updateContentType(boolean cleanDefaultRoot) throws MessagingException { BodyPart part = null; if (rootId == null) { part = getBodyPart(0); } else { part = getBodyPart(rootId); if (part == null) { if (cleanDefaultRoot) rootId = null; else throw new MessagingException("Can not set root: " + rootId + ": not found"); } } if (part != null) { String primaryType = baseContentTypeObject.getPrimaryType(); String subType = baseContentTypeObject.getSubType(); ParameterList params = baseContentTypeObject.getParameterList(); ContentType newContentType = new ContentType(primaryType, subType, params); ContentType rootContentType = new ContentType(part.getDataHandler().getContentType()); newContentType.setParameter("type", rootContentType.getBaseType()); if (rootId != null) newContentType.setParameter("start", stripBrackets(rootId)); contentType = newContentType.toString(); } }
private void updateContentType(boolean cleanDefaultRoot) throws MessagingException { BodyPart part = null; if (rootId == null) { part = getBodyPart(0); } else { part = getBodyPart(rootId); if (part == null) { if (cleanDefaultRoot) rootId = null; else throw new MessagingException("Can not set root: " + rootId + ": not found"); } } if (part != null) { String primaryType = baseContentTypeObject.getPrimaryType(); String subType = baseContentTypeObject.getSubType(); ParameterList params = baseContentTypeObject.getParameterList(); ContentType newContentType = new ContentType(primaryType, subType, params); ContentType rootContentType = new ContentType(part.getDataHandler().getContentType()); newContentType.setParameter("type", rootContentType.getBaseType()); if (rootId != null) newContentType.setParameter("start", stripBrackets(rootId)); contentType = newContentType.toString(); } }
String filename = cd.getParameter("filename"); if (filename != null) { ParameterList p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();
ContentType cType = new ContentType(s); p = cType.getParameterList(); if (p == null) { p = new ParameterList();