Class IssueFetcherUtil


  • public class IssueFetcherUtil
    extends java.lang.Object
    • Constructor Detail

      • IssueFetcherUtil

        public IssueFetcherUtil()
    • Method Detail

      • getHttpFile

        @NotNull
        public static java.io.InputStream getHttpFile​(@NotNull
                                                      java.lang.String url,
                                                      @Nullable
                                                      SimpleCredentials credentials,
                                                      boolean usePreemptiveAuthentication,
                                                      @Nullable
                                                      java.security.KeyStore trustStore,
                                                      @NotNull
                                                      HTTPRequestBuilder.ResponseConsumer errorsConsumer)
                                               throws java.io.IOException,
                                                      java.net.URISyntaxException
        Fetches the document from HTTP resource specified by url with the specified credentials. You have to close returned input stream. If authentication requires setting specific properties to request or uses custom logic implemented in authenticator, use getHttpFile(String, IssueFetcherAuthenticator, KeyStore, HTTPRequestBuilder.ResponseConsumer)
        Parameters:
        url - the url of file to fetch
        credentials - the data for authentication
        usePreemptiveAuthentication - is it necessary to use preemptive authentication
        trustStore - store with trusted SSL certificates
        errorsConsumer - the handler of HTTP errors after unsuccessful GET request
        Returns:
        result input stream
        Throws:
        java.io.IOException - if I/O error occurs
        java.net.URISyntaxException - if url parameter is not a valid uri
        Since:
        2018.1
      • getHttpFile

        public static java.io.InputStream getHttpFile​(@NotNull
                                                      java.lang.String url,
                                                      @NotNull
                                                      IssueFetcherAuthenticator authenticator,
                                                      @Nullable
                                                      java.security.KeyStore trustStore,
                                                      @NotNull
                                                      HTTPRequestBuilder.ResponseConsumer errorsConsumer)
                                               throws java.io.IOException,
                                                      java.net.URISyntaxException
        Throws:
        java.io.IOException
        java.net.URISyntaxException
      • retrieveCredentials

        @Nullable
        public static SimpleCredentials retrieveCredentials​(@Nullable
                                                            org.apache.commons.httpclient.Credentials credentials)
        Convert Apache Credentials object to SimpleCredentials.
        Parameters:
        credentials - nullable object to retrieve credentials
        Returns:
        converted SimpleCredentials object or null
        Since:
        2018.1