Skip to content

Commit

Permalink
Large file support for file share (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored May 18, 2021
1 parent fa287ac commit 36c0712
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
18 changes: 1 addition & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,7 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>azure-sdk</artifactId>
<version>4.vcb202d9010c1</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-file-share</artifactId>
<version>12.8.0</version>
<exclusions>
<exclusion>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
</exclusion>
<!-- we take the version from the azure-sdk -->
<exclusion>
<groupId>com.azure</groupId>
<artifactId>azure-storage-common</artifactId>
</exclusion>
</exclusions>
<version>12.vc102aedd3c66</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,14 @@ protected String uploadCloudFile(ShareFileClient fileClient, FilePath localPath)
try (FileInputStream fis = new FileInputStream(file); BufferedInputStream bis = new BufferedInputStream(fis)) {
long bytes = Files.size(file.toPath());
fileClient.create(bytes);
Response<ShareFileUploadInfo> response = fileClient.uploadWithResponse(bis, bis.available(), 0L,
null, null);

ShareFileUploadInfo response = fileClient.upload(bis, bis.available(), null);

long endTime = System.currentTimeMillis();
if (getServiceData().isVerbose()) {
println("Uploaded file with uri " + fileClient.getFileUrl() + " in " + getTime(endTime - startTime));
}
return DatatypeConverter.printHexBinary(response.getValue().getContentMd5());
return DatatypeConverter.printHexBinary(response.getContentMd5());
} catch (Exception e) {
throw new WAStorageException("Failed uploading file", e);
}
Expand Down

0 comments on commit 36c0712

Please sign in to comment.