Код: Выделить всё
CloudBlockBlobsourceBlob = container.getBlockBlobReference(sourceFilePath);
CloudFile destFile = cloudDir.getFileReference(destFileName);
File tmpCsvFile = Files.createTempFile(destFileName, "")
.toFile();
sourceBlob.downloadToFile(tmpCsvFile.getAbsolutePath().substring(0,
tmpCsvFile.getAbsolutePath().lastIndexOf(File.separator)) + File.separator + destFileName);
destFile.uploadFromFile(tmpCsvFile.getAbsolutePath().substring(0,
tmpCsvFile.getAbsolutePath().lastIndexOf(File.separator)) + File.separator + destFileName);
Я наткнулся на .startCopy и попытался использовать его, как показано ниже. Детали хранения, пути/имена файлов такие же, как и в предыдущем подходе.
Код: Выделить всё
CloudBlockBlob sourceBlob = container.getBlockBlobReference(sourceFilePath);
CloudFile destFile = cloudDir.getFileReference(destFileName);
if (!destFile.exists()) {
destFile.create(1024);
}
destFile.startCopy(sourceBlob);
Код: Выделить всё
com.microsoft.azure.storage.StorageException: The specified resource does not exist. " at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:89) ~[azure-storage-5.0.0.jar!/:?]" " at com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:305) ~[azure-storage-5.0.0.jar!/:?]" " at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:175) ~[azure-storage-5.0.0.jar!/:?]" " at com.microsoft.azure.storage.file.CloudFile.startCopy(CloudFile.java:472) ~[azure-storage-5.0.0.jar!/:?]" " at com.microsoft.azure.storage.file.CloudFile.startCopy(CloudFile.java:362) ~[azure-storage-5.0.0.jar!/:?]" " at com.microsoft.azure.storage.file.CloudFile.startCopy(CloudFile.java:320) ~[azure-storage-5.0.0.jar!/:?]"Подробнее здесь: https://stackoverflow.com/questions/784 ... oot-applic