3

I have a storage account from type ADLS Gen2, with 2 containers. I would like to copy a blob file from container A to container B, with java SDK. I'm using DataLakeFileSystemClient and I'm looking for something like the rename method of DataLakeFileClient which supports renaming to other container.

Heres the example of rename I did:

private DataLakeFileSystemClient fileSystemClient;

public boolean rename(String source, String target, String targetContainer) {
    DataLakeFileClient dataLakeFileClient = fileSystemClient.getFileClient(source).rename(targetContainer, target);
    return dataLakeFileClient.exists();
}

But I'm looking for only copying and not moving, Thanks.

Yaniv Irony
  • 149
  • 4
  • We can use Azure blob rest api to manage Azure Data Lake 2. So we can azure blob copy api to copy the file. For more details, please refer to here https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-known-issues#blob-storage-apis – Jim Xu Apr 23 '21 at 04:41

0 Answers0