Class HTTPURIHandler

  • All Implemented Interfaces:

    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 system variables.
    Andrea Aime - GeoSolutions
    • Field Summary

      • Fields inherited from interface URIHandler

    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canHandle​(URI uri)  
      InputStream 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 getConnectionTimeout()
      The current connection timeout
      int getReadTimeout()
      The current read timeout
      void 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
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HTTPURIHandler

        public HTTPURIHandler()
    • Method Detail

      • canHandle

        public boolean canHandle​(URI uri)
        Specified by:
        canHandle in interface URIHandler
        canHandle in class URIHandlerImpl
      • createInputStream

        public InputStream createInputStream​(URI uri,
                                             Map<?,​?> options)
                                      throws IOException
        Creates an input stream for the URI, assuming it's a URL, and returns it.
        Specified by:
        createInputStream in interface URIHandler
        createInputStream in class URIHandlerImpl
        an open input stream.
        IOException - if there is a problem obtaining an open input stream.
      • getConnection

        protected HttpURLConnection getConnection​(URI uri)
                                           throws IOException
      • getConnectionTimeout

        public int getConnectionTimeout()
        The current connection timeout
      • setConnectionTimeout

        public void setConnectionTimeout​(int connectionTimeout)
        Sets the connection timeout, in milliseconds. See URLConnection.setConnectTimeout(int)
      • getReadTimeout

        public int getReadTimeout()
        The current read timeout
      • setReadTimeout

        public void setReadTimeout​(int readTimeout)
        Sets the read timeout, in milliseconds. See URLConnection.setReadTimeout(int)