private String getContentTransferEncoding(String contentType) { if (useCTEBase64 && !CommonUtils.isTextualPart(contentType)) { return "base64"; } else { return "binary"; } }
/** * Writes the om to a log.debug. * This method assumes optimized mtom attachments * Also calculates the length of the message. * @param om OMElement * @param log Log * @return length of entire message */ public static long logDebug(OMElement om, Log log) { return logDebug(om, log, Integer.MAX_VALUE); }
/** * Get a string containing the stack of the specified exception * * @param e * @return TODO */ public static String stackToString(Throwable e) { java.io.StringWriter sw = new java.io.StringWriter(); java.io.BufferedWriter bw = new java.io.BufferedWriter(sw); java.io.PrintWriter pw = new java.io.PrintWriter(bw); e.printStackTrace(pw); pw.close(); String text = sw.getBuffer().toString(); // Jump past the throwable text = text.substring(text.indexOf("at")); text = replace(text, "at ", "DEBUG_FRAME = "); return text; }
public MTOMXMLStreamWriter(XMLStreamWriter xmlWriter) { this.xmlWriter = xmlWriter; if (log.isTraceEnabled()) { log.trace("Call Stack =" + CommonUtils.callStackToString()); } format = new OMOutputFormat(); optimizationPolicy = new OptimizationPolicyImpl(format); preserveAttachments = true; }
/** * Get a string containing the stack of the current location * * @return String */ public static String callStackToString() { return stackToString(new RuntimeException()); }
log.debug("Obtained next prefix:" + prefix); if (ADV_DEBUG_ENABLED && log.isTraceEnabled()) { log.trace(CommonUtils.callStackToString());
String stack = CommonUtils.stackToString(new OMException()); log.debug("call stack:" + stack); firstUseStack = CommonUtils.stackToString(new OMException()); if(log.isDebugEnabled()){ log.debug("ONE_USE_UNSAFE mode stack:" + firstUseStack);
} else { String contentType = dataHandler.getContentType().toLowerCase(); if (!contentType.startsWith("multipart/") && CommonUtils.isTextualPart(contentType)) { mainPart.setHeader("Content-Transfer-Encoding", "quoted-printable");
log.trace("Call Stack =" + CommonUtils.callStackToString());
/** * Writes the om to a log.debug. * This method assumes optimized mtom attachments * Also calculates the length of the message. * @param om OMElement * @param log Log * @param limit limit of message to write * @return length of entire message */ public static long logDebug(OMElement om, Log log, int limit) { OMOutputFormat format = new OMOutputFormat(); format.setDoOptimize(true); format.setIgnoreXMLDeclaration(true); return logDebug(om, log, limit, format); }
} else { String contentType = dataHandler.getContentType().toLowerCase(); if (!contentType.startsWith("multipart/") && CommonUtils.isTextualPart(contentType)) { mainPart.setHeader("Content-Transfer-Encoding", "quoted-printable");