Package org.openstreetmap.josm.tools
Class Http1Client.Http1Response
- java.lang.Object
-
- org.openstreetmap.josm.tools.HttpClient.Response
-
- org.openstreetmap.josm.tools.Http1Client.Http1Response
-
- Enclosing class:
- Http1Client
public static final class Http1Client.Http1Response extends HttpClient.Response
A wrapper for the HTTP 1.x response.
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.HttpURLConnection
connection
-
Constructor Summary
Constructors Modifier Constructor Description private
Http1Response(java.net.HttpURLConnection connection, ProgressMonitor progressMonitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disconnect()
Indicates that other requests to the server are unlikely in the near future.java.lang.String
getContentEncoding()
Returns theContent-Encoding
header.long
getContentLength()
Returns theContent-Length
header.java.lang.String
getContentType()
Returns theContent-Type
header.long
getExpiration()
Returns theExpire
header.java.lang.String
getHeaderField(java.lang.String name)
Returns the value of the named header field.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getHeaderFields()
Returns an unmodifiable Map mapping header keys to a List of header values.java.io.InputStream
getInputStream()
long
getLastModified()
Returns theLast-Modified
header.java.lang.String
getRequestMethod()
Returns the request method.java.net.URL
getURL()
Returns the URL.-
Methods inherited from class org.openstreetmap.josm.tools.HttpClient.Response
debugRedirect, fetchContent, getContent, getContentReader, getResponseCode, getResponseMessage, uncompress, uncompressAccordingToContentDisposition
-
-
-
-
Field Detail
-
connection
private final java.net.HttpURLConnection connection
-
-
Constructor Detail
-
Http1Response
private Http1Response(java.net.HttpURLConnection connection, ProgressMonitor progressMonitor) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getURL
public java.net.URL getURL()
Description copied from class:HttpClient.Response
Returns the URL.- Specified by:
getURL
in classHttpClient.Response
- Returns:
- the URL
- See Also:
URLConnection.getURL()
-
getRequestMethod
public java.lang.String getRequestMethod()
Description copied from class:HttpClient.Response
Returns the request method.- Specified by:
getRequestMethod
in classHttpClient.Response
- Returns:
- the HTTP request method
- See Also:
HttpURLConnection.getRequestMethod()
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Specified by:
getInputStream
in classHttpClient.Response
- Throws:
java.io.IOException
-
getContentEncoding
public java.lang.String getContentEncoding()
Description copied from class:HttpClient.Response
Returns theContent-Encoding
header.- Specified by:
getContentEncoding
in classHttpClient.Response
- Returns:
Content-Encoding
HTTP header- See Also:
URLConnection.getContentEncoding()
-
getContentType
public java.lang.String getContentType()
Description copied from class:HttpClient.Response
Returns theContent-Type
header.- Specified by:
getContentType
in classHttpClient.Response
- Returns:
Content-Type
HTTP header- See Also:
URLConnection.getContentType()
-
getExpiration
public long getExpiration()
Description copied from class:HttpClient.Response
Returns theExpire
header.- Specified by:
getExpiration
in classHttpClient.Response
- Returns:
Expire
HTTP header- See Also:
URLConnection.getExpiration()
-
getLastModified
public long getLastModified()
Description copied from class:HttpClient.Response
Returns theLast-Modified
header.- Specified by:
getLastModified
in classHttpClient.Response
- Returns:
Last-Modified
HTTP header- See Also:
URLConnection.getLastModified()
-
getContentLength
public long getContentLength()
Description copied from class:HttpClient.Response
Returns theContent-Length
header.- Specified by:
getContentLength
in classHttpClient.Response
- Returns:
Content-Length
HTTP header- See Also:
URLConnection.getContentLengthLong()
-
getHeaderField
public java.lang.String getHeaderField(java.lang.String name)
Description copied from class:HttpClient.Response
Returns the value of the named header field.- Specified by:
getHeaderField
in classHttpClient.Response
- Parameters:
name
- the name of a header field- Returns:
- the value of the named header field, or
null
if there is no such field in the header - See Also:
URLConnection.getHeaderField(String)
-
getHeaderFields
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaderFields()
Description copied from class:HttpClient.Response
Returns an unmodifiable Map mapping header keys to a List of header values. As per RFC 2616, section 4.2 header names are case insensitive, so returned map is also case insensitive- Specified by:
getHeaderFields
in classHttpClient.Response
- Returns:
- unmodifiable Map mapping header keys to a List of header values
- See Also:
URLConnection.getHeaderFields()
-
disconnect
public void disconnect()
Description copied from class:HttpClient.Response
Indicates that other requests to the server are unlikely in the near future.- Specified by:
disconnect
in classHttpClient.Response
- See Also:
HttpURLConnection.disconnect()
-
-