- 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.URLConnectionmyConnectionprivate ResourceLocator.SessionmySessionprivate java.lang.StringmyString
-
Constructor Summary
Constructors Constructor Description Response(ResourceLocator.Request request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetInputStream()Open a connection and get the input stream.ResourceLocator.RequestgetRequest()Will recreate the request that resulted in the final response.intgetStatusCode()java.io.ReadergetStreamReader()Open connection and return an input stream reader.booleanisResponseOK()voidprint(BasicLogger receiver)java.lang.StringtoString()
-
-
-
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:
printin interfaceBasicLogger.Printable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-