Class IssueFetcherUtil
- java.lang.Object
-
- jetbrains.buildServer.issueTracker.IssueFetcherUtil
-
public class IssueFetcherUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
IssueFetcherUtil.HttpErrorHandler
Deprecated.since 2018.1.
-
Field Summary
Fields Modifier and Type Field Description static HTTPRequestBuilder.ResponseConsumer
DEFAULT_GENERAL_HTTP_ERROR_HANDLER
static IssueFetcherUtil.HttpErrorHandler
DEFAULT_HTTP_ERROR_HANDLER
Deprecated.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 java.io.InputStream
getHttpFile(java.lang.String url, SimpleCredentials credentials, boolean usePreemptiveAuthentication, java.security.KeyStore trustStore, HTTPRequestBuilder.ResponseConsumer errorsConsumer)
Fetches the document from HTTP resource specified byurl
with the specified credentials.static java.io.InputStream
getHttpFile(java.lang.String url, IssueFetcherAuthenticator authenticator, java.security.KeyStore trustStore, HTTPRequestBuilder.ResponseConsumer errorsConsumer)
static java.io.InputStream
getHttpFile(java.lang.String url, IssueFetcherAuthenticator authenticator, IssueFetcherUtil.HttpErrorHandler httpErrorHandler)
Deprecated.since 2018.1.static SimpleCredentials
retrieveCredentials(IssueFetcherAuthenticator authenticator)
Convert deprecatedIssueFetcherAuthenticator
object toSimpleCredentials
.static SimpleCredentials
retrieveCredentials(org.apache.commons.httpclient.Credentials credentials)
Convert ApacheCredentials
object 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 java.io.InputStream getHttpFile(@NotNull java.lang.String url, @NotNull IssueFetcherAuthenticator authenticator, @NotNull IssueFetcherUtil.HttpErrorHandler httpErrorHandler) throws java.io.IOException
Deprecated.since 2018.1. UsegetHttpFile(String, IssueFetcherAuthenticator, KeyStore, HTTPRequestBuilder.ResponseConsumer)
insteadFetches the document from HTTP resource specified byurl
with the specified credentials.- Parameters:
url
- the url of file to fetchauthenticator
- authenticator- Returns:
- result input stream, or null in case of HTTP error
- Throws:
java.io.IOException
- if I/O error occurs
-
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 byurl
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, 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:
java.io.IOException
- if I/O error occursjava.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(@NotNull IssueFetcherAuthenticator authenticator)
Convert deprecatedIssueFetcherAuthenticator
object toSimpleCredentials
.- Parameters:
authenticator
- not null object to retrieve credentials- Returns:
- converted
SimpleCredentials
object ornull
- Since:
- 2018.1
-
retrieveCredentials
@Nullable public static SimpleCredentials retrieveCredentials(@Nullable org.apache.commons.httpclient.Credentials credentials)
Convert ApacheCredentials
object toSimpleCredentials
.- Parameters:
credentials
- nullable object to retrieve credentials- Returns:
- converted
SimpleCredentials
object ornull
- Since:
- 2018.1
-
-