Author: veithen
Date: Wed Oct  8 12:01:28 2008
New Revision: 702967

URL: http://svn.apache.org/viewvc?rev=702967&view=rev
Log:
MailTransportSender: Removed the code used to set up the default 
MailcapCommandMap. Indeed:
* The only content handler we really depend on is that for multipart/mixed and 
we can assume that it is set up correctly by default by the JavaMail 
implementation.
* The code explicitly refers to Sun's JavaMail implementation and therefore 
breaks compatibility with other implementation (e.g. Geronimo).

Modified:
    
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java

Modified: 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java?rev=702967&r1=702966&r2=702967&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
 (original)
+++ 
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportSender.java
 Wed Oct  8 12:01:28 2008
@@ -38,8 +38,6 @@
 import javax.mail.*;
 import javax.mail.internet.*;
 import javax.activation.DataHandler;
-import javax.activation.MailcapCommandMap;
-import javax.activation.CommandMap;
 
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
@@ -124,17 +122,6 @@
             session = Session.getInstance(props, null);
         }
 
-        // add handlers for main MIME types
-        MailcapCommandMap mc = (MailcapCommandMap) 
CommandMap.getDefaultCommandMap();
-        mc.addMailcap("text/html;; 
x-java-content-handler=com.sun.mail.handlers.text_html");
-        mc.addMailcap("text/xml;; 
x-java-content-handler=com.sun.mail.handlers.text_xml");
-        mc.addMailcap("application/xml;; 
x-java-content-handler=com.sun.mail.handlers.text_xml");
-        mc.addMailcap("application/soap+xml;; 
x-java-content-handler=com.sun.mail.handlers.text_xml");
-        mc.addMailcap("text/plain;; 
x-java-content-handler=com.sun.mail.handlers.text_plain");
-        mc.addMailcap("multipart/*;; 
x-java-content-handler=com.sun.mail.handlers.multipart_mixed");
-        mc.addMailcap("message/rfc822;; 
x-java-content-handler=com.sun.mail.handlers.message_rfc822");
-        CommandMap.setDefaultCommandMap(mc);
-        
         session.setDebug(log.isTraceEnabled());
 
         // set the synchronise callback table


Reply via email to