Author: veithen Date: Tue May 19 18:20:26 2009 New Revision: 776403 URL: http://svn.apache.org/viewvc?rev=776403&view=rev Log: Removed two deprecated methods from MIMEOutputUtils. Anyway they didn't work because they relied on the DataHandler(Object, String) constructor, but there is no data content handler registered for text/xml.
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java?rev=776403&r1=776402&r2=776403&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java Tue May 19 18:20:26 2009 @@ -55,68 +55,6 @@ private static byte[] CRLF = { 13, 10 }; /** - * @deprecated is anyone really using this? - * - * Invoked by MTOMXMLStreamWriter to write the SOAP Part and the attachemts - * @param outStream OutputStream target - * @param bufferedXML String containing XML of SOAPPart - * @param binaryNodeList Text nodes with the attachment Data Handlers - * @param boundary Boundary String - * @param contentId Content-ID of SOAPPart - * @param charSetEncoding Character Encoding of SOAPPart - * @param SOAPContentType Content-Type of SOAPPart - */ - public static void complete(OutputStream outStream, - String bufferedXML, - LinkedList binaryNodeList, - String boundary, - String contentId, - String charSetEncoding, - String SOAPContentType) { - try { - // TODO: Instead of buffering the SOAPPart contents, it makes more - // sense to split this method in two. Write out the SOAPPart headers - // and later write out the attachments. This will avoid the cost and - // space of buffering. - - // Write out the mime boundary - startWritingMime(outStream, boundary); - - javax.activation.DataHandler dh = - new javax.activation.DataHandler(bufferedXML, - "text/xml; charset=" + charSetEncoding); - MimeBodyPart rootMimeBodyPart = new MimeBodyPart(); - rootMimeBodyPart.setDataHandler(dh); - - rootMimeBodyPart.addHeader("Content-Type", - "application/xop+xml; charset=" + charSetEncoding + - "; type=\"" + SOAPContentType + "\""); - rootMimeBodyPart.addHeader("Content-Transfer-Encoding", "binary"); - rootMimeBodyPart.addHeader("Content-ID", "<" + contentId + ">"); - - // Write out the SOAPPart - writeBodyPart(outStream, rootMimeBodyPart, boundary); - - // Now write out the Attachment parts (which are represented by the - // text nodes int the binary node list) - Iterator binaryNodeIterator = binaryNodeList.iterator(); - while (binaryNodeIterator.hasNext()) { - OMText binaryNode = (OMText) binaryNodeIterator.next(); - writeBodyPart(outStream, createMimeBodyPart(binaryNode - .getContentID(), (DataHandler) binaryNode - .getDataHandler()), boundary); - } - finishWritingMime(outStream); - outStream.flush(); - } catch (IOException e) { - throw new OMException("Error while writing to the OutputStream.", e); - } catch (MessagingException e) { - throw new OMException("Problem writing Mime Parts.", e); - } - } - - - /** * Invoked by MTOMXMLStreamWriter to write the SOAP Part and the attachements. * * @param outStream OutputStream target @@ -205,30 +143,6 @@ } } - /** - * @deprecated - is anyone really using this? - * - * Write the SOAPPart and attachments - * @param outStream - * @param writer - * @param binaryNodeList - * @param boundary - * @param contentId - * @param charSetEncoding - * @param SOAPContentType - */ - public static void complete(OutputStream outStream, StringWriter writer, - LinkedList binaryNodeList, String boundary, String contentId, - String charSetEncoding, String SOAPContentType) { - complete(outStream, - writer.toString(), - binaryNodeList, - boundary, - contentId, - charSetEncoding, - SOAPContentType); - } - public static MimeBodyPart createMimeBodyPart(String contentID, DataHandler dataHandler) throws MessagingException {