From 36c07129d7d345a276e8760e33a60e3b4c4f6b3a Mon Sep 17 00:00:00 2001
From: Tim Jacomb <21194782+timja@users.noreply.github.com>
Date: Tue, 18 May 2021 21:18:28 +0100
Subject: [PATCH] Large file support for file share (#193)
---
pom.xml | 18 +-----------------
.../service/UploadService.java | 6 +++---
2 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/pom.xml b/pom.xml
index 95ecdb39..17925ddd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,23 +46,7 @@
io.jenkins.plugins
azure-sdk
- 4.vcb202d9010c1
-
-
- com.azure
- azure-storage-file-share
- 12.8.0
-
-
- com.azure
- azure-core
-
-
-
- com.azure
- azure-storage-common
-
-
+ 12.vc102aedd3c66
org.jenkins-ci.plugins
diff --git a/src/main/java/com/microsoftopentechnologies/windowsazurestorage/service/UploadService.java b/src/main/java/com/microsoftopentechnologies/windowsazurestorage/service/UploadService.java
index 54b4f3fa..e0b24661 100644
--- a/src/main/java/com/microsoftopentechnologies/windowsazurestorage/service/UploadService.java
+++ b/src/main/java/com/microsoftopentechnologies/windowsazurestorage/service/UploadService.java
@@ -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 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);
}