in teamcity-s3-sdk/src/main/java/jetbrains/buildServer/artifacts/s3/publish/presigned/upload/TeamCityServerPresignedUrlsProviderClient.java [87:112]
public Collection<PresignedUrlDto> getRegularPresignedUrls(@NotNull final List<String> objectKeys, @NotNull Map<String, String> digests) {
validateClient();
try {
final HTTPRequestBuilder post = postTemplate()
.withData(s3ObjectKeysRequestEntity(objectKeys, digests));
int maxHeaders = TeamCityProperties.getInteger(S3_ARTIFACT_KEYS_HEADER_MAX_NUMBER, DEFAULT_ARTIFACT_KEYS_HEADER_MAX_NUMBER);
for (int i = 0; i < Math.min(maxHeaders, objectKeys.size()); i++) {
post.withHeader(S3Constants.S3_ARTIFACT_KEYS_HEADER_NAME, objectKeys.get(i));
}
setNodeIdCookie(post);
final String responseBody = HttpClientUtil.executeAndReleaseConnection(post, myErrorHandler).get().getResponse();
if (StringUtil.isEmpty(responseBody)) {
throw new FetchFailedException("Response returned with empty body");
}
return deserializeResponseV2(responseBody).getPresignedUrls();
} catch (HttpClientUtil.HttpErrorCodeException | URISyntaxException | ExecutionException e) {
LOGGER.warnAndDebugDetails("Failed resolving S3 pre-signed URL from " + myServerUrl + ", got exception " + e.getMessage(), e);
throw new FetchFailedException(e);
} catch (InterruptedException e) {
throw new FetchFailedException("Resolving S3 pre-signed URL was interrupted");
}
}