Class IssueFetcherUtil
- java.lang.Object
-
- jetbrains.buildServer.issueTracker.IssueFetcherUtil
-
public class IssueFetcherUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceIssueFetcherUtil.HttpErrorHandlerDeprecated.since 2018.1.
-
Field Summary
Fields Modifier and Type Field Description static HTTPRequestBuilder.ResponseConsumerDEFAULT_GENERAL_HTTP_ERROR_HANDLERstatic IssueFetcherUtil.HttpErrorHandlerDEFAULT_HTTP_ERROR_HANDLERDeprecated.since 2018.1.
-
Constructor Summary
Constructors Constructor Description IssueFetcherUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static InputStreamgetHttpFile(String url, SimpleCredentials credentials, boolean usePreemptiveAuthentication, KeyStore trustStore, HTTPRequestBuilder.ResponseConsumer errorsConsumer)Fetches the document from HTTP resource specified byurlwith the specified credentials.static InputStreamgetHttpFile(String url, IssueFetcherAuthenticator authenticator, KeyStore trustStore, HTTPRequestBuilder.ResponseConsumer errorsConsumer)static InputStreamgetHttpFile(String url, IssueFetcherAuthenticator authenticator, IssueFetcherUtil.HttpErrorHandler httpErrorHandler)Deprecated.since 2018.1.static SimpleCredentialsretrieveCredentials(IssueFetcherAuthenticator authenticator)Convert deprecatedIssueFetcherAuthenticatorobject toSimpleCredentials.static SimpleCredentialsretrieveCredentials(org.apache.commons.httpclient.Credentials credentials)Convert ApacheCredentialsobject toSimpleCredentials.
-
-
-
Field Detail
-
DEFAULT_HTTP_ERROR_HANDLER
@NotNull @Deprecated public static final IssueFetcherUtil.HttpErrorHandler DEFAULT_HTTP_ERROR_HANDLER
Deprecated.since 2018.1. UseDEFAULT_GENERAL_HTTP_ERROR_HANDLER
-
DEFAULT_GENERAL_HTTP_ERROR_HANDLER
@NotNull public static final HTTPRequestBuilder.ResponseConsumer DEFAULT_GENERAL_HTTP_ERROR_HANDLER
-
-
Method Detail
-
getHttpFile
@NotNull @Deprecated public static InputStream getHttpFile(@NotNull String url, @NotNull IssueFetcherAuthenticator authenticator, @NotNull IssueFetcherUtil.HttpErrorHandler httpErrorHandler) throws IOException
Deprecated.since 2018.1. UsegetHttpFile(String, IssueFetcherAuthenticator, KeyStore, HTTPRequestBuilder.ResponseConsumer)insteadFetches the document from HTTP resource specified byurlwith the specified credentials.- Parameters:
url- the url of file to fetchauthenticator- authenticator- Returns:
- result input stream, or null in case of HTTP error
- Throws:
IOException- if I/O error occurs
-
getHttpFile
@NotNull public static InputStream getHttpFile(@NotNull String url, @Nullable SimpleCredentials credentials, boolean usePreemptiveAuthentication, @Nullable KeyStore trustStore, @NotNull HTTPRequestBuilder.ResponseConsumer errorsConsumer) throws IOException, URISyntaxException
Fetches the document from HTTP resource specified byurlwith 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, usegetHttpFile(String, IssueFetcherAuthenticator, KeyStore, HTTPRequestBuilder.ResponseConsumer)- Parameters:
url- the url of file to fetchcredentials- the data for authenticationusePreemptiveAuthentication- is it necessary to use preemptive authenticationtrustStore- store with trusted SSL certificateserrorsConsumer- the handler of HTTP errors after unsuccessful GET request- Returns:
- result input stream
- Throws:
IOException- if I/O error occursURISyntaxException- if url parameter is not a valid uri- Since:
- 2018.1
-
getHttpFile
public static InputStream getHttpFile(@NotNull String url, @NotNull IssueFetcherAuthenticator authenticator, @Nullable KeyStore trustStore, @NotNull HTTPRequestBuilder.ResponseConsumer errorsConsumer) throws IOException, URISyntaxException
- Throws:
IOExceptionURISyntaxException
-
retrieveCredentials
@Nullable public static SimpleCredentials retrieveCredentials(@NotNull IssueFetcherAuthenticator authenticator)
Convert deprecatedIssueFetcherAuthenticatorobject toSimpleCredentials.- Parameters:
authenticator- not null object to retrieve credentials- Returns:
- converted
SimpleCredentialsobject ornull - Since:
- 2018.1
-
retrieveCredentials
@Nullable public static SimpleCredentials retrieveCredentials(@Nullable org.apache.commons.httpclient.Credentials credentials)
Convert ApacheCredentialsobject toSimpleCredentials.- Parameters:
credentials- nullable object to retrieve credentials- Returns:
- converted
SimpleCredentialsobject ornull - Since:
- 2018.1
-
-