Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | package de.viathinksoft.utils.http; |
2 | |||
3 | import java.io.File; |
||
4 | import java.io.UnsupportedEncodingException; |
||
5 | |||
6 | import org.apache.http.entity.mime.MultipartEntity; |
||
7 | import org.apache.http.entity.mime.content.FileBody; |
||
8 | import org.apache.http.entity.mime.content.StringBody; |
||
9 | |||
10 | public class MultipartPostData extends MultipartEntity { |
||
11 | |||
12 | void addString(String name, String value) |
||
13 | throws UnsupportedEncodingException { |
||
14 | this.addPart(name, new StringBody(value)); |
||
15 | } |
||
16 | |||
17 | void addString(String name, File file) { |
||
18 | this.addPart(name, new FileBody(file)); |
||
19 | } |
||
20 | |||
21 | } |