当前位置: 首页>>代码示例>>Java>>正文


Java CloudBlobContainer.listBlobs方法代码示例

本文整理汇总了Java中com.microsoft.azure.storage.blob.CloudBlobContainer.listBlobs方法的典型用法代码示例。如果您正苦于以下问题:Java CloudBlobContainer.listBlobs方法的具体用法?Java CloudBlobContainer.listBlobs怎么用?Java CloudBlobContainer.listBlobs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.microsoft.azure.storage.blob.CloudBlobContainer的用法示例。


在下文中一共展示了CloudBlobContainer.listBlobs方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listObjects

import com.microsoft.azure.storage.blob.CloudBlobContainer; //导入方法依赖的package包/类
/**
 * For a set of remote storage objects under a remote location and a given prefix/path
 * returns their properties wrapped in ObjectSummary objects
 *
 * @param remoteStorageLocation location, i.e. container for Azure
 * @param prefix                the prefix/path to list under
 * @return a collection of storage summary objects
 * @throws StorageProviderException Azure storage exception
 */
@Override
public StorageObjectSummaryCollection listObjects(String remoteStorageLocation, String prefix)
        throws StorageProviderException
{
  StorageObjectSummaryCollection storageObjectSummaries;

  try
  {
    CloudBlobContainer container = azStorageClient.getContainerReference(remoteStorageLocation);
    Iterable<ListBlobItem> listBlobItemIterable = container.listBlobs(
            prefix,       // List the BLOBs under this prefix
            true          // List the BLOBs as a flat list, i.e. do not list directories
            );
    storageObjectSummaries = new StorageObjectSummaryCollection(listBlobItemIterable);
  }
  catch (URISyntaxException | StorageException ex)
  {
    logger.debug("Failed to list objects: {}", ex);
    throw new StorageProviderException(ex);
  }
  return storageObjectSummaries;
}
 
开发者ID:snowflakedb,项目名称:snowflake-jdbc,代码行数:32,代码来源:SnowflakeAzureClient.java

示例2: getSnapshotFileKeys

import com.microsoft.azure.storage.blob.CloudBlobContainer; //导入方法依赖的package包/类
private Map<String, Long> getSnapshotFileKeys(CloudBlobContainer container, String keyPrefix) {
  Map<String, Long> snapshotFiles = new HashMap<>();

  try {
    for (ListBlobItem item : container.listBlobs(keyPrefix, true)) {
      if (item instanceof CloudPageBlob) {
        CloudPageBlob cloudBlob = (CloudPageBlob) item;
        snapshotFiles.put(cloudBlob.getName(), getOriginalFileSize(cloudBlob));
      }
    }
  } catch (StorageException e) {
    logger.error("Unable to retrieve metadata.", e);
    // all or none
    snapshotFiles = new HashMap<>();
  }
  return snapshotFiles;
}
 
开发者ID:mesosphere,项目名称:dcos-cassandra-service,代码行数:18,代码来源:AzureStorageDriver.java

示例3: listImages

import com.microsoft.azure.storage.blob.CloudBlobContainer; //导入方法依赖的package包/类
public String[] listImages() throws Exception {
    CloudBlobContainer container = getContainer();

    Iterable<ListBlobItem> blobs = container.listBlobs();

    LinkedList<String> blobNames = new LinkedList<>();
    for (ListBlobItem blob : blobs) {
        blobNames.add(((CloudBlockBlob) blob).getName());
    }

    return blobNames.toArray(new String[blobNames.size()]);
}
 
开发者ID:BANKEX,项目名称:smart-asset-iot-android-demo,代码行数:13,代码来源:ImageManager.java

示例4: listAllBlobbs

import com.microsoft.azure.storage.blob.CloudBlobContainer; //导入方法依赖的package包/类
public static List<String> listAllBlobbs(String containerName){

    List<String> blobsList = new ArrayList<>();
    CloudBlobContainer container = AzureConnectionManager.getContainer(containerName,true);
    // Loop over blobs within the container and output the URI to each of them.
    for (ListBlobItem blobItem : container.listBlobs()) {
      blobsList.add(blobItem.getUri().toString());
    }
    return blobsList;
  }
 
开发者ID:project-sunbird,项目名称:sunbird-utils,代码行数:11,代码来源:AzureFileUtility.java

示例5: ListImages

import com.microsoft.azure.storage.blob.CloudBlobContainer; //导入方法依赖的package包/类
public static String[] ListImages() throws Exception{
    CloudBlobContainer container = getContainer();

    Iterable<ListBlobItem> blobs = container.listBlobs();

    LinkedList<String> blobNames = new LinkedList<>();
    for(ListBlobItem blob: blobs) {
        blobNames.add(((CloudBlockBlob) blob).getName());
    }

    return blobNames.toArray(new String[blobNames.size()]);
}
 
开发者ID:Azure-Samples,项目名称:storage-blob-android-photo-uploader,代码行数:13,代码来源:ImageManager.java

示例6: listBlobs

import com.microsoft.azure.storage.blob.CloudBlobContainer; //导入方法依赖的package包/类
@NotNull
public static String listBlobs(@NotNull final StorageInputs inputs) throws Exception {
    final CloudBlobClient blobClient = getCloudBlobClient(inputs);
    final CloudBlobContainer container = blobClient.getContainerReference(inputs.getContainerName());
    final List<String> blobList = new ArrayList<>();
    for (final ListBlobItem blobItem : container.listBlobs()) {
        final String path = blobItem.getUri().getPath();
        blobList.add(path.substring(path.lastIndexOf(FORWARD_SLASH) + 1));
    }
    return StringUtilities.join(blobList, COMMA);
}
 
开发者ID:CloudSlang,项目名称:cs-actions,代码行数:12,代码来源:StorageServiceImpl.java

示例7: listBlobs

import com.microsoft.azure.storage.blob.CloudBlobContainer; //导入方法依赖的package包/类
public Iterable<ListBlobItem> listBlobs(final String containerName, final String prefix, final boolean useFlatBlobListing)
        throws URISyntaxException, StorageException, InvalidKeyException {
    CloudBlobClient cloudBlobClient = connection.getCloudStorageAccount().createCloudBlobClient();
    CloudBlobContainer cloudBlobContainer = cloudBlobClient.getContainerReference(containerName);
    return cloudBlobContainer.listBlobs(prefix, useFlatBlobListing);
}
 
开发者ID:Talend,项目名称:components,代码行数:7,代码来源:AzureStorageBlobService.java


注:本文中的com.microsoft.azure.storage.blob.CloudBlobContainer.listBlobs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。