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.HttpURLConnectionconnection
-
Constructor Summary
Constructors Modifier Constructor Description privateHttp1Response(java.net.HttpURLConnection connection, ProgressMonitor progressMonitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisconnect()Indicates that other requests to the server are unlikely in the near future.java.lang.StringgetContentEncoding()Returns theContent-Encodingheader.longgetContentLength()Returns theContent-Lengthheader.java.lang.StringgetContentType()Returns theContent-Typeheader.longgetExpiration()Returns theExpireheader.java.lang.StringgetHeaderField(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.InputStreamgetInputStream()longgetLastModified()Returns theLast-Modifiedheader.java.lang.StringgetRequestMethod()Returns the request method.java.net.URLgetURL()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.ResponseReturns the URL.- Specified by:
getURLin classHttpClient.Response- Returns:
- the URL
- See Also:
URLConnection.getURL()
-
getRequestMethod
public java.lang.String getRequestMethod()
Description copied from class:HttpClient.ResponseReturns the request method.- Specified by:
getRequestMethodin classHttpClient.Response- Returns:
- the HTTP request method
- See Also:
HttpURLConnection.getRequestMethod()
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Specified by:
getInputStreamin classHttpClient.Response- Throws:
java.io.IOException
-
getContentEncoding
public java.lang.String getContentEncoding()
Description copied from class:HttpClient.ResponseReturns theContent-Encodingheader.- Specified by:
getContentEncodingin classHttpClient.Response- Returns:
Content-EncodingHTTP header- See Also:
URLConnection.getContentEncoding()
-
getContentType
public java.lang.String getContentType()
Description copied from class:HttpClient.ResponseReturns theContent-Typeheader.- Specified by:
getContentTypein classHttpClient.Response- Returns:
Content-TypeHTTP header- See Also:
URLConnection.getContentType()
-
getExpiration
public long getExpiration()
Description copied from class:HttpClient.ResponseReturns theExpireheader.- Specified by:
getExpirationin classHttpClient.Response- Returns:
ExpireHTTP header- See Also:
URLConnection.getExpiration()
-
getLastModified
public long getLastModified()
Description copied from class:HttpClient.ResponseReturns theLast-Modifiedheader.- Specified by:
getLastModifiedin classHttpClient.Response- Returns:
Last-ModifiedHTTP header- See Also:
URLConnection.getLastModified()
-
getContentLength
public long getContentLength()
Description copied from class:HttpClient.ResponseReturns theContent-Lengthheader.- Specified by:
getContentLengthin classHttpClient.Response- Returns:
Content-LengthHTTP header- See Also:
URLConnection.getContentLengthLong()
-
getHeaderField
public java.lang.String getHeaderField(java.lang.String name)
Description copied from class:HttpClient.ResponseReturns the value of the named header field.- Specified by:
getHeaderFieldin classHttpClient.Response- Parameters:
name- the name of a header field- Returns:
- the value of the named header field, or
nullif 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.ResponseReturns 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:
getHeaderFieldsin 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.ResponseIndicates that other requests to the server are unlikely in the near future.- Specified by:
disconnectin classHttpClient.Response- See Also:
HttpURLConnection.disconnect()
-
-