Interface HTTPClient

  • All Known Implementing Classes:

    public interface HTTPClient
    Abstraction for opening an InputStream on an HTTP IRI.
    Richard Cyganiak (
    • Method Detail

      • init

        void init​(HTTPClientConfiguration configuration)
        Initializes the HTTP client.
        configuration - configuration for the HTTP Client.
      • openInputStream

        InputStream openInputStream​(String uri)
                             throws IOException
        Opens the input stream for the given target IRI.
        uri - target IRI.
        input stream to access IRI content.
        IOException - if any error occurs while reading the IRI content.
      • close

        void close()
        Release all static resources help by the instance. Call this method only if you are sure you will not use it again in your application, like for example when shutting down a servlet context.
      • getContentType

        String getContentType()
        The value of the Content-Type header reported by the server. Can be null.
        the content type as string.
      • getContentLength

        long getContentLength()
        content length in bytes.
      • getActualDocumentIRI

        String getActualDocumentIRI()
        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.
        actual document IRI.