Skip to content

Commit b5f815a

Browse files
committed
fix bug of uploading artifact to adls
1 parent 51a054c commit b5f815a

File tree

1 file changed

+3
-4
lines changed
  • Utils/hdinsight-node-common/src/com/microsoft/azure/hdinsight/sdk/storage/adls

1 file changed

+3
-4
lines changed

Utils/hdinsight-node-common/src/com/microsoft/azure/hdinsight/sdk/storage/adls/WebHDFSUtils.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public static void uploadFileToADLS(@NotNull IHDIStorageAccount storageAccount,
6666
OutputStream stream = null;
6767
try {
6868
stream = client.createFile(remotePath, IfExists.OVERWRITE);
69+
IOUtils.copy(new FileInputStream(localFile), stream);
70+
stream.flush();
71+
stream.close();
6972
} catch (ADLException e) {
7073
// ADLS operation may get a 403 when 'user' didn't have access to ADLS under Service Principle model
7174
// currently we didn't have a good way to solve this problem
@@ -76,9 +79,5 @@ public static void uploadFileToADLS(@NotNull IHDIStorageAccount storageAccount,
7679
} finally {
7780
IOUtils.closeQuietly(stream);
7881
}
79-
80-
IOUtils.copy(new FileInputStream(localFile), stream);
81-
stream.flush();
82-
stream.close();
8382
}
8483
}

0 commit comments

Comments
 (0)