axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rineh...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/attachments MimeUtils.java
Date Sun, 02 Dec 2001 19:15:13 GMT
rineholt    01/12/02 11:15:13

  Modified:    java/src/org/apache/axis/attachments MimeUtils.java
  Log:
  Changes which should not be necessary; but some HTTP servers don't seem to
  understand multi-line headers.
  
  Revision  Changes    Path
  1.4       +15 -1     xml-axis/java/src/org/apache/axis/attachments/MimeUtils.java
  
  Index: MimeUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/attachments/MimeUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MimeUtils.java	2001/11/25 19:05:05	1.3
  +++ MimeUtils.java	2001/12/02 19:15:13	1.4
  @@ -202,7 +202,21 @@
        * This routine will get the content type.
        */
       public static String getContentType(javax.mail.internet.MimeMultipart mp) {
  -        return  mp.getContentType();
  +        String ct= mp.getContentType();
  +        StringBuffer ret= new StringBuffer();
  +        for(java.util.StringTokenizer st= new java.util.StringTokenizer(ct, "\n\r"); st.hasMoreTokens();
){
  +            String line= st.nextToken();
  +            if(line != null && 0 < line.length()){
  +                int i=0;
  +                for(; i < line.length() ; ++i ) {
  +                    char n = line.charAt(i);
  +                    if(n != ' ' || n != '\t' ) break;
  +                }       
  +                if( i >1 ) line= line.substring(i-1);
  +                if(line.length() >0) ret.append(line);
  +            }    
  +        }
  +        return  ret.toString(); 
       }
       /**
        * This routine will create a multipar object from the parts and the SOAP content.
  
  
  

Mime
View raw message