Skip to content

Commit

Permalink
Change API of Bdio2FileUploadService.uploadFile to return Bdio2Upload…
Browse files Browse the repository at this point in the history
…Result instead of HttpUrl.
  • Loading branch information
crowleySynopsys committed May 3, 2022
1 parent 8bedd33 commit badda28
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public Bdio2FileUploadService(
this.bdio2Uploader = bdio2Uploader;
}

public HttpUrl uploadFile(UploadTarget uploadTarget, long timeout) throws IntegrationException, InterruptedException {
public Bdio2UploadResult uploadFile(UploadTarget uploadTarget, long timeout) throws IntegrationException, InterruptedException {
logger.debug(String.format("Uploading BDIO file %s", uploadTarget.getUploadFile()));
List<BdioFileContent> bdioFileContentList = bdio2Extractor.extractContent(uploadTarget.getUploadFile());
return uploadFiles(bdioFileContentList, uploadTarget.getProjectAndVersion().orElse(null), timeout);
}

private HttpUrl uploadFiles(List<BdioFileContent> bdioFiles, @Nullable NameVersion nameVersion, long timeout) throws IntegrationException, InterruptedException {
private Bdio2UploadResult uploadFiles(List<BdioFileContent> bdioFiles, @Nullable NameVersion nameVersion, long timeout) throws IntegrationException, InterruptedException {
if (bdioFiles.isEmpty()) {
throw new IllegalArgumentException("BDIO files cannot be empty.");
}
Expand All @@ -78,8 +78,7 @@ private HttpUrl uploadFiles(List<BdioFileContent> bdioFiles, @Nullable NameVersi
Bdio2UploadJob bdio2UploadJob = new Bdio2UploadJob(bdio2Uploader, header, remainingFiles, editor, count);
ResilientJobExecutor jobExecutor = new ResilientJobExecutor(jobConfig);

return jobExecutor.executeJob(bdio2UploadJob)
.getUploadUrl();
return jobExecutor.executeJob(bdio2UploadJob);
}

}

0 comments on commit badda28

Please sign in to comment.