axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/transport/http HTTPConstants.java
Date Sat, 29 Jun 2002 21:55:40 GMT
dims        2002/06/29 14:55:40

  Modified:    java/src/org/apache/axis Part.java SOAPPart.java
               java/src/org/apache/axis/attachments AttachmentPart.java
                        MimeUtils.java MultiPartRelatedInputStream.java
               java/src/org/apache/axis/transport/http HTTPConstants.java
  Log:
  Various fixes for MimeHeader's related stuff.
  
  Revision  Changes    Path
  1.9       +11 -4     xml-axis/java/src/org/apache/axis/Part.java
  
  Index: Part.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Part.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Part.java	29 May 2002 13:05:54 -0000	1.8
  +++ Part.java	29 Jun 2002 21:55:39 -0000	1.9
  @@ -84,14 +84,21 @@
   public interface Part
   {
       /**
  -     * Add the specified MIME header, as per JAXM.
  +     * Gets all the values of the <CODE>MimeHeader</CODE> object
  +     * in this <CODE>SOAPPart</CODE> object that is identified by
  +     * the given <CODE>String</CODE>.
  +     * @param   name  the name of the header; example:
  +     *     "Content-Type"
  +     * @return a <CODE>String</CODE> array giving all the values for
  +     *     the specified header
  +     * @see #setMimeHeader(java.lang.String, java.lang.String) setMimeHeader(java.lang.String,
java.lang.String)
        */
  -    public void addMimeHeader (String header, String value);
  +    public abstract String[] getMimeHeader(String name);
   
       /**
  -     * Get the specified MIME header.
  +     * Add the specified MIME header, as per JAXM.
        */
  -    public String getFirstMimeHeader (String header);
  +    public void addMimeHeader (String header, String value);
   
       /**
        * Content location.
  
  
  
  1.26      +2 -19     xml-axis/java/src/org/apache/axis/SOAPPart.java
  
  Index: SOAPPart.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SOAPPart.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- SOAPPart.java	23 Jun 2002 17:06:30 -0000	1.25
  +++ SOAPPart.java	29 Jun 2002 21:55:39 -0000	1.26
  @@ -472,30 +472,13 @@
        * Add the specified MIME header, as per JAXM.
        */
       public void addMimeHeader (String header, String value) {
  -
  -        if(null == header) {
  -            throw new IllegalArgumentException(JavaUtils.getMessage("headerNotNull"));
  -        }
  -
  -        header = header.trim();
  -
  -        if(header.length() == 0) {
  -            throw new IllegalArgumentException(
  -                    JavaUtils.getMessage("headerNotEmpty"));
  -        }
  -
  -        if(null == value) {
  -            throw new IllegalArgumentException(
  -                    JavaUtils.getMessage("headerValueNotNull"));
  -        }
  -        mimeHeaders.setHeader(header.toLowerCase(), value);
  +        mimeHeaders.setHeader(header, value);
       }
   
       /**
        * Get the specified MIME header.
        */
  -    public String getFirstMimeHeader (String header) {
  -        //return (String) headers.get(header.toLowerCase());
  +    private String getFirstMimeHeader (String header) {
           String[] values = mimeHeaders.getHeader(header);
           if(values != null && values.length>0)
               return values[0];
  
  
  
  1.14      +1 -19     xml-axis/java/src/org/apache/axis/attachments/AttachmentPart.java
  
  Index: AttachmentPart.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/attachments/AttachmentPart.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AttachmentPart.java	24 Jun 2002 21:36:13 -0000	1.13
  +++ AttachmentPart.java	29 Jun 2002 21:55:39 -0000	1.14
  @@ -133,25 +133,7 @@
        * @param value
        */
       public void addMimeHeader(String header, String value) {
  -
  -        if (null == header) {
  -            throw new IllegalArgumentException(
  -                    JavaUtils.getMessage("headerNotNull"));
  -        }
  -
  -        header = header.trim();
  -
  -        if (header.length() == 0) {
  -            throw new IllegalArgumentException(
  -                    JavaUtils.getMessage("headerNotEmpty"));
  -        }
  -
  -        if (null == value) {
  -            throw new IllegalArgumentException(
  -                    JavaUtils.getMessage("headerValueNotNull"));
  -        }
  -
  -        mimeHeaders.setHeader(header.toLowerCase(), value);
  +        mimeHeaders.setHeader(header, value);
       }
   
       /**
  
  
  
  1.16      +5 -4      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MimeUtils.java	24 Jun 2002 12:34:51 -0000	1.15
  +++ MimeUtils.java	29 Jun 2002 21:55:39 -0000	1.16
  @@ -282,7 +282,7 @@
               messageBodyPart.setText(env);
               messageBodyPart.setHeader("Content-Type",
                       "text/xml; charset=UTF-8");
  -            messageBodyPart.setHeader("Content-ID", "<" + rootCID + ">");
  +            messageBodyPart.setHeader("Content-Id", "<" + rootCID + ">");
               messageBodyPart.setHeader(
                       HTTPConstants.HEADER_CONTENT_TRANSFER_ENCODING, "binary");
               multipart.addBodyPart(messageBodyPart);
  @@ -324,9 +324,10 @@
                               HTTPConstants.HEADER_CONTENT_ID,
                               HTTPConstants.HEADER_CONTENT_TRANSFER_ENCODING}); i.hasNext();)
{
                       String header = (String) i.next();
  -
  -                    messageBodyPart.setHeader(header,
  -                            part.getFirstMimeHeader(header));
  +                    String values[] = part.getMimeHeader(header);
  +                    for(int j=0;j<values.length;j++){
  +                        messageBodyPart.setHeader(header, values[j]);
  +                    }
                   }
   
                   multipart.addBodyPart(messageBodyPart);
  
  
  
  1.14      +1 -1      xml-axis/java/src/org/apache/axis/attachments/MultiPartRelatedInputStream.java
  
  Index: MultiPartRelatedInputStream.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/attachments/MultiPartRelatedInputStream.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MultiPartRelatedInputStream.java	24 Jun 2002 12:34:51 -0000	1.13
  +++ MultiPartRelatedInputStream.java	29 Jun 2002 21:55:39 -0000	1.14
  @@ -505,7 +505,7 @@
                               new javax.mail.internet.InternetHeaders(
                                       boundaryDelimitedStream);
   
  -                    contentId = headers.getHeader("Content-ID", null);
  +                    contentId = headers.getHeader("Content-Id", null);
   
                       if (contentId != null) {
                           contentId = contentId.trim();
  
  
  
  1.22      +1 -1      xml-axis/java/src/org/apache/axis/transport/http/HTTPConstants.java
  
  Index: HTTPConstants.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/HTTPConstants.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- HTTPConstants.java	25 Jun 2002 17:59:33 -0000	1.21
  +++ HTTPConstants.java	29 Jun 2002 21:55:40 -0000	1.22
  @@ -80,7 +80,7 @@
       public static final String HEADER_CONTENT_TYPE_JMS = "ContentType";
       public static final String HEADER_CONTENT_LENGTH = "Content-Length";
       public static final String HEADER_CONTENT_LOCATION = "Content-Location";
  -    public static final String HEADER_CONTENT_ID = "Content-ID";
  +    public static final String HEADER_CONTENT_ID = "Content-Id";
       public static final String HEADER_SOAP_ACTION = "SOAPAction";
       public static final String HEADER_AUTHORIZATION = "Authorization";
       public static final String HEADER_PROXY_AUTHORIZATION = "Proxy-Authorization";
  
  
  

Mime
View raw message