in src/main/java/com/amazonaws/codepipeline/jenkinsplugin/DownloadCallable.java [64:98]
public Void invoke(final File workspace, final VirtualChannel channel) throws InterruptedException {
clearWorkspaceIfSelected(workspace, listener);
final AWSClients awsClients = awsClientFactory.getAwsClient(
model.getAwsAccessKey(),
model.getAwsSecretKey(),
model.getProxyHost(),
model.getProxyPort(),
model.getRegion(),
pluginUserAgentPrefix);
final AWSCodePipelineJobCredentialsProvider credentialsProvider = new AWSCodePipelineJobCredentialsProvider(
job.getId(), awsClients.getCodePipelineClient());
final AmazonS3 s3Client = awsClients.getS3Client(credentialsProvider);
for (final Artifact artifact : job.getData().getInputArtifacts()) {
final S3Object sessionObject = getS3Object(s3Client, artifact);
model.setCompressionType(ExtractionTools.getCompressionType(sessionObject, listener));
final String downloadedFileName = Paths.get(sessionObject.getKey()).getFileName().toString();
try {
downloadAndExtract(sessionObject, workspace, downloadedFileName, listener);
} catch (final Exception ex) {
final String error = "Failed to acquire artifacts: " + ex.getMessage();
LoggingHelper.log(listener, error);
LoggingHelper.log(listener, ex);
throw new InterruptedException(error);
}
}
return null;
}