使用Azure Blob存储,将网址数据复制到blob?

时间:2017-07-28 10:53:16

标签: java azure azure-storage-blobs

  

对于CloudBlockBlob类型

,方法startCopy(URL)未定义

编译以下代码时出现上述错误 -

import com.microsoft.azure.storage.CloudStorageAccount;
import com.microsoft.azure.storage.blob.CloudBlob;
import com.microsoft.azure.storage.blob.CloudBlobClient;
import com.microsoft.azure.storage.blob.CloudBlobContainer;
import com.microsoft.azure.storage.blob.CloudBlockBlob;

public class CopyFromURLToBlob {
    public static final String storageConnectionString = "xyz" ; 
    public static void main(String[] args) {
        String connectionString = String.format(storageConnectionString);
        CloudStorageAccount account = CloudStorageAccount.parse(connectionString);
        CloudBlobClient client = account.createCloudBlobClient();
        CloudBlobContainer container = client.getContainerReference("dbpcontent");
        CloudBlockBlob blob = container.getBlockBlobReference("directcopytoblobfromUrl.txt");

        String url = "http://downloads.dbpedia.org/2016-10/dbpedia_2016-10.owl";
        blob.startCopy(new URL(url));
        }}

0 个答案:

没有答案