Package org.geotools.xsd.impl
Class HTTPURIHandler
Object
URIHandlerImpl
HTTPURIHandler
- All Implemented Interfaces:
URIHandler
public class HTTPURIHandler
extends URIHandlerImpl
A URI handler that handles HTTP connections with connection timeouts and read timeouts. The default timeouts are 10
seconds, they can be set interactively on an instance of the
HTTPURIHandler
, and default values can be
overridden setting the
org.geotools.xsd.http.connection.timeout
and org.geotools.xsd.http.read.timeout
system variables.- Author:
- Andrea Aime - GeoSolutions
-
Field Summary
Fields inherited from interface URIHandler
DEFAULT_HANDLERS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(URI uri) createInputStream
(URI uri, Map<?, ?> options) Creates an input stream for the URI, assuming it's a URL, and returns it.protected HttpURLConnection
getConnection
(URI uri) int
The current connection timeoutint
The current read timeoutvoid
setConnectionTimeout
(int connectionTimeout) Sets the connection timeout, in milliseconds.void
setReadTimeout
(int readTimeout) Sets the read timeout, in milliseconds.Methods inherited from class URIHandlerImpl
contentDescription, createOutputStream, delete, exists, getAttributes, getRequestedAttributes, getResponse, getTimeout, getURIConverter, setAttributes
-
Constructor Details
-
HTTPURIHandler
public HTTPURIHandler()
-
-
Method Details
-
canHandle
public boolean canHandle(URI uri) - Specified by:
canHandle
in interfaceURIHandler
- Overrides:
canHandle
in classURIHandlerImpl
-
createInputStream
Creates an input stream for the URI, assuming it's a URL, and returns it.- Specified by:
createInputStream
in interfaceURIHandler
- Overrides:
createInputStream
in classURIHandlerImpl
- Returns:
- an open input stream.
- Throws:
IOException
- if there is a problem obtaining an open input stream.
-
getConnection
- Throws:
IOException
-
getConnectionTimeout
public int getConnectionTimeout()The current connection timeout -
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) Sets the connection timeout, in milliseconds. SeeURLConnection.setConnectTimeout(int)
-
getReadTimeout
public int getReadTimeout()The current read timeout -
setReadTimeout
public void setReadTimeout(int readTimeout) Sets the read timeout, in milliseconds. SeeURLConnection.setReadTimeout(int)
-