|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.electrotank.electroserver4.extensions.api.value.HttpResults
public class HttpResults
Contains the result of a call to a url, and a variety of methods to interact with the data directly as bytes, convert it to a string, or to even parse the results into a name/value pair map (like LoadVars in Flash).
ElectroServerApi.blockAndCallUrl,
HttpCallback| Field Summary | |
|---|---|
static String |
DEFAULT_ENCODING
|
static String |
UTF8
|
| Constructor Summary | |
|---|---|
HttpResults()
Constructs a new instance of HttpResults. |
|
| Method Summary | |
|---|---|
byte[] |
getDataAsBytes()
Gets the data from the url as an array of bytes. |
Map<String,String> |
getDataAsMap()
Gets the data from the url as a name/value pair map (like LoadVars in Flash). |
Map<String,String> |
getDataAsMap(String encoding)
Gets the data from the url as a name/value pair map (like LoadVars in Flash). |
String |
getDataAsString()
Gets the data from the url as a string, using the default encoding. |
String |
getDataAsString(String encoding)
Gets the data from the url as a string. |
String |
getErrorText()
Gets the error message if the call was unsuccessful. |
void |
setDataAsBytes(byte[] dataAsBytes)
Sets the data from the url to the given array of bytes. |
void |
setErrorText(String errorText)
Sets the error message. |
void |
setSuccessful(boolean successful)
Sets a flag indicating whether the call to a url was successful. |
boolean |
wasSuccessful()
Gets a flag indicating whether the call to a url was successful. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String UTF8
public static final String DEFAULT_ENCODING
| Constructor Detail |
|---|
public HttpResults()
| Method Detail |
|---|
public boolean wasSuccessful()
public void setSuccessful(boolean successful)
successful - true if the call to the url was successfulpublic byte[] getDataAsBytes()
public void setDataAsBytes(byte[] dataAsBytes)
dataAsBytes - data as an array of bytespublic String getDataAsString(String encoding)
encoding - encoding to be used for the string
public String getDataAsString()
public Map<String,String> getDataAsMap(String encoding)
encoding - string encoding
public Map<String,String> getDataAsMap()
public String getErrorText()
public void setErrorText(String errorText)
errorText - error message
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||