Class AbstractStreamProvider

    • Field Detail

      • INSECURE_TRUST_MANAGERS

        protected static final TrustManager[] INSECURE_TRUST_MANAGERS
    • Constructor Detail

      • AbstractStreamProvider

        public AbstractStreamProvider()
    • Method Detail

      • getSocketFactory

        protected abstract SSLSocketFactory getSocketFactory()
        Returns:
        the socket factory, or null if not needed
      • openConnection

        public URLConnection openConnection​(String url,
                                            Map<String,​String> headers,
                                            int connectTimeout,
                                            int readTimeout)
                                     throws IOException
        Open URL connection to the specified URL.
        Parameters:
        url - the url
        headers - the headers map
        connectTimeout - connection timeout in ms
        readTimeout - read timeout in ms
        Returns:
        the URL connection
        Throws:
        IOException - when an error occurs
      • openStream

        public InputStream openStream​(String url,
                                      Map<String,​String> headers,
                                      int connectTimeout,
                                      int readTimeout)
                               throws IOException
        Description copied from interface: StreamProvider
        Open stream to the specified URL.
        Specified by:
        openStream in interface StreamProvider
        Parameters:
        url - the url
        headers - the headers map
        connectTimeout - connection timeout in ms
        readTimeout - read timeout in ms
        Returns:
        the stream
        Throws:
        IOException - when an error occurs