hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r811556 - /httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
Date Fri, 04 Sep 2009 21:22:18 GMT
Author: olegk
Date: Fri Sep  4 21:22:17 2009
New Revision: 811556

URL: http://svn.apache.org/viewvc?rev=811556&view=rev
Log:
HTTPCLIENT-874: Override method MultipartEntity.addPart so that applications may use FormBodyPart
Contributed by Gerald Turner <gturner at unzane.com>

Modified:
    httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java?rev=811556&r1=811555&r2=811556&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
(original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntity.java
Fri Sep  4 21:22:17 2009
@@ -43,6 +43,7 @@
 import org.apache.http.message.BasicHeader;
 import org.apache.http.protocol.HTTP;
 import org.apache.james.mime4j.field.Fields;
+import org.apache.james.mime4j.message.BodyPart;
 import org.apache.james.mime4j.message.Message;
 
 /**
@@ -121,11 +122,18 @@
         return buffer.toString();
     }
 
-    public void addPart(final String name, final ContentBody contentBody) {
-        this.multipart.addBodyPart(new FormBodyPart(name, contentBody));
+    /**
+     * @since 4.1
+     */
+    public void addPart(final BodyPart bodyPart) {
+        this.multipart.addBodyPart(bodyPart);
         this.dirty = true;
     }
-  
+
+    public void addPart(final String name, final ContentBody contentBody) {
+        addPart(new FormBodyPart(name, contentBody));
+    }
+
     public boolean isRepeatable() {
         List<?> parts = this.multipart.getBodyParts();
         for (Iterator<?> it = parts.iterator(); it.hasNext(); ) {



Mime
View raw message