You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2004/11/04 13:58:51 UTC

cvs commit: ws-axis/java/src/org/apache/axis/attachments AttachmentPart.java

dims        2004/11/04 04:58:51

  Modified:    java/src/org/apache/axis/attachments AttachmentPart.java
  Log:
  Fix for:
  AXIS-1640 - Implementation of setContent in AttachmentPart is wrong
  
  from:
  Chelliah Thirunavukkarasu (chelliah@versai.com)
  
  Revision  Changes    Path
  1.46      +3 -2      ws-axis/java/src/org/apache/axis/attachments/AttachmentPart.java
  
  Index: AttachmentPart.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/attachments/AttachmentPart.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- AttachmentPart.java	8 Apr 2004 13:09:05 -0000	1.45
  +++ AttachmentPart.java	4 Nov 2004 12:58:51 -0000	1.46
  @@ -373,6 +373,7 @@
        */
       public void setContent(Object object, String contentType) {
           ManagedMemoryDataSource source = null;
  +        setMimeHeader(HTTPConstants.HEADER_CONTENT_TYPE, contentType);
           if (object instanceof String) {
               try {
                   String s = (String) object;
  @@ -397,7 +398,7 @@
                           contentType, true);
                   extractFilename(source);
                   datahandler = new DataHandler(source);
  -                contentObject = object;
  +                contentObject = null; // the stream has been consumed
                   return;
               } catch (java.io.IOException io) {
                   log.error(Messages.getMessage("javaIOException00"), io);
  @@ -411,7 +412,7 @@
                           contentType, true);
                   extractFilename(source);
                   datahandler = new DataHandler(source);
  -                contentObject = object;
  +                contentObject = null; // the stream has been consumed
                   return;
               } catch (java.io.IOException io) {
                   log.error(Messages.getMessage("javaIOException00"), io);