| Modifier and Type | Field and Description |
|---|---|
private SupportForm |
form
Used to gather user input and system information.
|
private static org.slf4j.Logger |
logger |
private org.apache.commons.httpclient.methods.PostMethod |
method
Handy reference to the status code (and more) of our
POST. |
private static int |
POST_ATTEMPTS
We'll follow up to this many redirects for
requestUrl. |
private String |
requestUrl
URL that we'll attempt to
POST our requests at. |
private int |
tryCount
Number of redirects we've tried since starting.
|
private String |
validFormUrl
Keeps track of the most recent redirect for
requestUrl. |
| Constructor and Description |
|---|
Submitter(SupportForm form) |
| Modifier and Type | Method and Description |
|---|---|
private static org.apache.commons.httpclient.methods.multipart.FilePart |
buildFakeFilePart(String id,
String file,
byte[] data)
Creates a file attachment that isn't based upon an actual file.
|
private static org.apache.commons.httpclient.methods.PostMethod |
buildPostMethod(String url,
SupportForm form)
Attempts to
POST to url using the information from
form. |
private static org.apache.commons.httpclient.methods.multipart.FilePart |
buildRealFilePart(String id,
String file)
Creates a file attachment that's based upon a real file.
|
protected String |
compute() |
protected void |
onCompletion(String result,
Throwable exception,
boolean cancelled) |
cancel, get, get, isCancelled, isDone, onProgress, run, setProgressprivate static final org.slf4j.Logger logger
private static final int POST_ATTEMPTS
requestUrl.private final SupportForm form
private final String requestUrl
POST our requests at.private String validFormUrl
requestUrl.private int tryCount
private org.apache.commons.httpclient.methods.PostMethod method
POST.public Submitter(SupportForm form)
private static org.apache.commons.httpclient.methods.multipart.FilePart buildRealFilePart(String id, String file)
id - The parameter ID. Usually something like
"form_data[att_two]".file - Path to the file that's going to be attached.POST-able file attachment using the name and contents of
file.private static org.apache.commons.httpclient.methods.multipart.FilePart buildFakeFilePart(String id, String file, byte[] data)
id - Parameter ID. Typically something like
"form_data[att_extra]".file - Fake name of the file. Can be whatever you like.data - The actual data to place inside the attachment.POST-able file attachment using a spoofed filename!private static org.apache.commons.httpclient.methods.PostMethod buildPostMethod(String url, SupportForm form)
POST to url using the information from
form.url - URL that'll accept the POST. Typically
requestUrl.form - The SupportForm that contains the data to use in the
support request.protected String compute()
compute in class BackgroundTask<String>protected void onCompletion(String result, Throwable exception, boolean cancelled)
onCompletion in class BackgroundTask<String>