Package com.grapecity.documents.excel
Class WebRequestResult
java.lang.Object
com.grapecity.documents.excel.WebRequestResult
Represents the result of a web request, including the success status, the response content, any connection failure, and the HTTP status code.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Gets the response content from the web request, if the request was successful.intGets the HTTP status code of the web request.booleanChecks if the web request failed due to a connection issue.voidsetConnectionFailed(boolean connectionFailed) Sets the connection failure status of the web request.voidsetResponseContent(byte[] responseContent) Sets the response content from the web request.voidsetStatusCode(int statusCode) Sets the HTTP status code of the web request.
-
Constructor Details
-
WebRequestResult
public WebRequestResult()
-
-
Method Details
-
getStatusCode
public int getStatusCode()Gets the HTTP status code of the web request.- Returns:
- the HTTP status code
-
setStatusCode
public void setStatusCode(int statusCode) Sets the HTTP status code of the web request.- Parameters:
statusCode- the HTTP status code
-
isConnectionFailed
public boolean isConnectionFailed()Checks if the web request failed due to a connection issue.- Returns:
- true if the request failed due to a connection issue, false otherwise
-
setConnectionFailed
public void setConnectionFailed(boolean connectionFailed) Sets the connection failure status of the web request.- Parameters:
connectionFailed- true if the request failed due to a connection issue, false otherwise
-
getResponseContent
public byte[] getResponseContent()Gets the response content from the web request, if the request was successful. The content is stored as a byte array to preserve the original data format.- Returns:
- the response content as a byte array
-
setResponseContent
public void setResponseContent(byte[] responseContent) Sets the response content from the web request.- Parameters:
responseContent- the response content as a byte array
-