Class DefaultHTTPClient

  • All Implemented Interfaces:

    public class DefaultHTTPClient
    extends Object
    implements HTTPClient
    Opens an InputStream on an HTTP IRI. Is configured with sane values for timeouts, default headers and so on.
    Paolo Capriotti, Richard Cyganiak (
    • Constructor Detail

      • DefaultHTTPClient

        public DefaultHTTPClient()
    • Method Detail

      • init

        public void init​(HTTPClientConfiguration configuration)
        Description copied from interface: HTTPClient
        Initializes the HTTP client.
        Specified by:
        init in interface HTTPClient
        configuration - configuration for the HTTP Client.
      • close

        public void close()
        Shuts down the connection manager.
        Specified by:
        close in interface HTTPClient
      • getContentLength

        public long getContentLength()
        Specified by:
        getContentLength in interface HTTPClient
        content length in bytes.
      • getActualDocumentIRI

        public String getActualDocumentIRI()
        Description copied from interface: HTTPClient
        Returns the actual IRI from which the document was fetched. This might differ from the IRI passed to openInputStream() if a redirect was performed. A return value of null means that the IRI is unchanged and the original IRI was used.
        Specified by:
        getActualDocumentIRI in interface HTTPClient
        actual document IRI.
      • getContentType

        public String getContentType()
        Description copied from interface: HTTPClient
        The value of the Content-Type header reported by the server. Can be null.
        Specified by:
        getContentType in interface HTTPClient
        the content type as string.
      • getConnectionTimeout

        protected int getConnectionTimeout()
      • getSoTimeout

        protected int getSoTimeout()