Class HttpInputStreamUtil


  • public final class HttpInputStreamUtil
    extends java.lang.Object
    Utility method for reading data from an HTTP InputStream.
    • Constructor Detail

      • HttpInputStreamUtil

        public HttpInputStreamUtil()
    • Method Detail

      • getInputStream

        public static HttpInputStreamUtil.Result getInputStream​(LastModifiedSource source,
                                                                AuthorizationProvider authorizationProvider)
        Retrieves an HTTP resource if it has been modified.

        Side effects: if the request is successful, the last modified time of the source parameter is modified.

        Parameters:
        source - The location of the HTTP resource
        authorizationProvider - The authentication data for the HTTP request
        Returns:
        A HttpInputStreamUtil.Result object containing the status code and body of the response
      • formatProtocol

        private static Supplier<java.lang.String> formatProtocol​(Source source)
      • readStream

        public static byte[] readStream​(java.io.InputStream is)
                                 throws java.io.IOException
        Throws:
        java.io.IOException