Class TimeoutHttpClientHandler

  • All Implemented Interfaces:
    AutoCloseable, org.apache.ivy.util.url.TimeoutConstrainedURLHandler, org.apache.ivy.util.url.URLHandler

    public class TimeoutHttpClientHandler
    extends org.apache.ivy.util.url.HttpClientHandler
    A HttpClientHandler which uses HttpClient for downloading via http/https and have support for connection timeouts which otherwise is not supported by default in Apache Ivy.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.ivy.util.url.URLHandler

        org.apache.ivy.util.url.URLHandler.URLInfo
    • Field Summary

      • Fields inherited from interface org.apache.ivy.util.url.URLHandler

        REQUEST_METHOD_GET, REQUEST_METHOD_HEAD, UNAVAILABLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getTimeout()  
      org.apache.ivy.util.url.URLHandler.URLInfo getURLInfo​(URL url)  
      InputStream openStream​(URL url)  
      void setTimeout​(int timeout)
      Sets the timeout in millis (http.socket.timeout) when downloading via http/https protocols.
      • Methods inherited from class org.apache.ivy.util.url.HttpClientHandler

        close, download, download, getContentLength, getLastModified, getURLInfo, getURLInfo, isReachable, openStream, upload, upload
      • Methods inherited from class org.apache.ivy.util.url.AbstractURLHandler

        createTimeoutConstraints, getContentLength, getContentLength, getDecodingInputStream, getLastModified, getLastModified, getRequestMethod, getUserAgent, isReachable, isReachable, normalizeToString, normalizeToURL, setRequestMethod, validatePutStatusCode
      • Methods inherited from interface org.apache.ivy.util.url.URLHandler

        getContentLength, getContentLength, getLastModified, getLastModified, isReachable, isReachable, setRequestMethod
    • Constructor Detail

      • TimeoutHttpClientHandler

        public TimeoutHttpClientHandler()
    • Method Detail

      • getTimeout

        public int getTimeout()
      • setTimeout

        public void setTimeout​(int timeout)
        Sets the timeout in millis (http.socket.timeout) when downloading via http/https protocols.

        The default value is 10000

      • getURLInfo

        public org.apache.ivy.util.url.URLHandler.URLInfo getURLInfo​(URL url)
        Specified by:
        getURLInfo in interface org.apache.ivy.util.url.URLHandler
        Overrides:
        getURLInfo in class org.apache.ivy.util.url.HttpClientHandler
      • openStream

        public InputStream openStream​(URL url)
                               throws IOException
        Specified by:
        openStream in interface org.apache.ivy.util.url.URLHandler
        Overrides:
        openStream in class org.apache.ivy.util.url.HttpClientHandler
        Throws:
        IOException