Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 057FA9CE0 for ; Thu, 8 Nov 2012 08:38:16 +0000 (UTC) Received: (qmail 30772 invoked by uid 500); 8 Nov 2012 08:38:15 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 30638 invoked by uid 500); 8 Nov 2012 08:38:14 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 30196 invoked by uid 99); 8 Nov 2012 08:38:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 08:38:12 +0000 Date: Thu, 8 Nov 2012 08:38:12 +0000 (UTC) From: "Jinhua Wang (JIRA)" To: issues@cxf.apache.org Message-ID: <717607348.86047.1352363892695.JavaMail.jiratomcat@arcas> In-Reply-To: <1055554121.73245.1352188692229.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CXF-4616) When creating DataContentHandler, defaultCommandMap should be considered. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493041#comment-13493041 ] Jinhua Wang commented on CXF-4616: ---------------------------------- Thank you Daniel. # When constructing MailcapCommandMap or its subclass, constructor would load resources from "META-INF/mailcap" which can be found from mail.jar. Therefore when mail.jar on the classpath, specific content-handlers are found and printed.If without mail.jar on the classpath, those content-handlers printed out cannot be found. # There are different dataContentHandler implementations, such as |RI|no config/static initializer from AttachmentPartImpl| |javamail|load config from meta/mailcap| |geronimo-mail|load config from meta/mailcap| If without javamail or geronimo on classpath, there is only ImageDataContentHandler provided by cxf. Content-handler provided by RI is preferred when mail.jar is not on the classpath. Therefore, a new subclass of MailcapCommandMap is created to get defaultCommadMap configurations which have been filled by a static initializer in RI. # There is a sequence issue between static initializer and adding things to AttachmentUtil.getCommandMap(). #* As it is a static initializer in RI(AttachmentPartImpl), static initializer is invoked by JVM and out of our control. #* That is before static initializer execution, there is nothing in defaultCommandMap. And there is nothing to be added to AttachmentUtil.getCommandMap(). # Update EnhancedMailcapCommandMap and add two CommandMap test in attachments. EnhancedMailcapCommandMap overrides getAllCommands(), getCommand(), getMimeTypes methods. Please help to review my thoughts and code. > When creating DataContentHandler, defaultCommandMap should be considered. > ------------------------------------------------------------------------- > > Key: CXF-4616 > URL: https://issues.apache.org/jira/browse/CXF-4616 > Project: CXF > Issue Type: Bug > Affects Versions: 2.6.3 > Reporter: Jinhua Wang > Attachments: AttachmentUtil.java.patch, AttachmentUtilTest.java, AttachmentUtilWithoutAttachmentPartTest.java, EnhancedMailcapCommandMap.java > > > When creating DataContentHandler, null may be returned from CXF's static CommandMap. DefaultCommandMap from *CommandMap.getDefaultCommandMap()* could also be used to create DataContentHandler. > Because in RI implementation,xxx.*saaj.soap.AttachmentPartImpl*, > Some static statement would add specific content handler to default CommandMap. > {code} > CommandMap localCommandMap = CommandMap.getDefaultCommandMap(); > localMailcapCommandMap.addMailcap("text/xml" + str + "xxx.saaj.soap.XmlDataContentHandler"); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira