axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sami...@apache.org
Subject svn commit: r536212 - /webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
Date Tue, 08 May 2007 14:57:20 GMT
Author: saminda
Date: Tue May  8 07:57:19 2007
New Revision: 536212

URL: http://svn.apache.org/viewvc?view=rev&rev=536212
Log:
Removing quotes if present in a header 

Modified:
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java?view=diff&rev=536212&r1=536211&r2=536212
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/transport/mail/SimpleMailListener.java
Tue May  8 07:57:19 2007
@@ -418,13 +418,7 @@
             String values[] = msg.getHeader(headerName);
 
             if (values != null) {
-                String tmp = values[0];
-                if (tmp != null) {
-                    if (tmp.length() > 1 && tmp.startsWith("\"") && tmp.endsWith("\""))
{
-                        tmp = tmp.substring(1, tmp.length() - 1);
-                    }
-                }
-                return tmp;
+                return parseHeaderForQuotes(values[0]);
             } else {
                 return null;
             }
@@ -433,12 +427,22 @@
         }
     }
 
+    private String parseHeaderForQuotes(String value) {
+        if (value != null) {
+            if (value.length() > 1 && value.startsWith("\"") && value.endsWith("\""))
{
+                value = value.substring(1, value.length() - 1);
+            }
+
+        }
+        return value;
+    }
+
     private String getMailHeaderFromPart(Part part, String headerName) throws AxisFault {
         try {
             String values[] = part.getHeader(headerName);
 
             if (values != null) {
-                return values[0];
+                return parseHeaderForQuotes(values[0]);
             } else {
                 return null;
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message