Interface Submitter.Response
- Enclosing interface:
Submitter
public static interface Submitter.Response
Represents the response received from executing a request.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA supplier forInputStreamthat can throw anIOException. -
Method Summary
Modifier and TypeMethodDescriptionstatic Submitter.Responsecreate(int statusCode, Submitter.Response.InputStreamSupplier supplier, Exception exception) Creates a newSubmitter.Responseinstance.Gets the exception that occurred during execution, if any.Gets the response body input stream.intGets the HTTP response status code, or 0 / -1 if a client-side exception occurred.default StringReads the entire response body stream as a UTF-8 String.
-
Method Details
-
create
static Submitter.Response create(int statusCode, Submitter.Response.InputStreamSupplier supplier, Exception exception) Creates a newSubmitter.Responseinstance.- Parameters:
statusCode- the status codesupplier- the input stream supplier (can be null)exception- the exception (can be null)- Returns:
- the response instance
-
getStatusCode
int getStatusCode()Gets the HTTP response status code, or 0 / -1 if a client-side exception occurred.- Returns:
- the status code
-
getInputStream
Gets the response body input stream.- Returns:
- the input stream
- Throws:
IOException- if an I/O error occurs
-
getException
-
readString
-