Package org.ojalgo.netio
Class ResourceLocator.Response
- java.lang.Object
-
- org.ojalgo.netio.ResourceLocator.Response
-
- All Implemented Interfaces:
BasicLogger.Printable
- Enclosing class:
- ResourceLocator
public static final class ResourceLocator.Response extends java.lang.Object implements BasicLogger.Printable
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.URLConnection
myConnection
private ResourceLocator.Session
mySession
private java.lang.String
myString
-
Constructor Summary
Constructors Constructor Description Response(ResourceLocator.Request request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
getInputStream()
Open a connection and get the input stream.ResourceLocator.Request
getRequest()
Will recreate the request that resulted in the final response.int
getStatusCode()
java.io.Reader
getStreamReader()
Open connection and return an input stream reader.boolean
isResponseOK()
void
print(BasicLogger receiver)
java.lang.String
toString()
-
-
-
Field Detail
-
myConnection
private final java.net.URLConnection myConnection
-
mySession
private final ResourceLocator.Session mySession
-
myString
private transient java.lang.String myString
-
-
Constructor Detail
-
Response
Response(ResourceLocator.Request request)
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream()
Open a connection and get the input stream.
-
getRequest
public ResourceLocator.Request getRequest()
Will recreate the request that resulted in the final response. If there has been one or more redirects, then this is NOT the same as the original request.
-
getStatusCode
public int getStatusCode()
- Returns:
- The http response status code, or -1 if this is not http/hhtps or if the code cannot be discerned from the response
-
getStreamReader
public java.io.Reader getStreamReader()
Open connection and return an input stream reader. This method can only be called once on each instance, and thetoString()
and#print(Printer)
methods delegate to this method. (Those methods can be called multiple timea.)
-
isResponseOK
public boolean isResponseOK()
- Returns:
- true if the status (response) code is in [200,300)
-
print
public void print(BasicLogger receiver)
- Specified by:
print
in interfaceBasicLogger.Printable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-