|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pulpcore.net.Upload
public class Upload
The Upload class represents name/value pairs for sending to an HTTP server via the POST method (multipart form). Values can be either plain text or files.
Constructor Summary | |
---|---|
Upload(URL url)
Creates a new Upload object. |
Method Summary | |
---|---|
void |
addField(String name,
String value)
Add a plain text form field to this form. |
void |
addFields(Map fields)
Adds plain text form fields to this form. |
void |
addFile(String name,
String fileName,
String mimeType,
byte[] fileData)
Add a data file to this form. |
String |
getResponse()
|
IOException |
getUncaughtException()
|
boolean |
isCompleted()
|
void |
run()
|
void |
sendNow()
Deprecated. Use send(false); |
void |
start()
Write the form to an URL via the POST method. |
void |
start(boolean asynchronous)
Write the form to an URL via the POST method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Upload(URL url)
url
- the URL to send the POST to.Method Detail |
---|
public void addFields(Map fields)
public void addField(String name, String value)
public void addFile(String name, String fileName, String mimeType, byte[] fileData)
public void run()
run
in interface Runnable
public void start()
public void start(boolean asynchronous)
asynchronous
- true for asynchronous operation
(the call returns immediately) or false for synchronous operation (the call
blocks until the method is complete or an error occurs).public void sendNow() throws IOException
IOException
- if an error occurs.public String getResponse()
public boolean isCompleted()
public IOException getUncaughtException()
|
PulpCore | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |