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


Java BlobListingDetails类代码示例

本文整理汇总了Java中com.microsoft.azure.storage.blob.BlobListingDetails的典型用法代码示例。如果您正苦于以下问题:Java BlobListingDetails类的具体用法?Java BlobListingDetails怎么用?Java BlobListingDetails使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BlobListingDetails类属于com.microsoft.azure.storage.blob包,在下文中一共展示了BlobListingDetails类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listBlobs

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
@Override
public Iterable<ListBlobItem> listBlobs(String prefix,
    boolean useFlatBlobListing, EnumSet<BlobListingDetails> listingDetails,
    BlobRequestOptions options, OperationContext opContext)
    throws URISyntaxException, StorageException {
  return WrappingIterator.wrap(directory.listBlobs(prefix,
      useFlatBlobListing, listingDetails, options, opContext));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:StorageInterfaceImpl.java

示例2: listLogBlobs

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
/**
 * Returns an enumerable collection of log blobs, retrieved lazily.
 * 
 * @param service
 *            A {@link StorageService} enumeration value that indicates which storage service to use.
 * @param startTime
 *            A <code>java.util.Date</code> object representing the start of the time range for which logs should
 *            be retrieved.
 * @param endTime
 *            A <code>java.util.Date</code> object representing the end of the time range for which logs should
 *            be retrieved.
 * @param operations
 *            A {@link LoggingOperations} enumeration set that indicates which log types to return.
 * @param details
 *            A {@link BlobListingDetails} enumeration set that indicates whether or not blob metadata should
 *            be returned. None or METADATA are the only valid values.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies additional options for the request.
 * @param operationContext
 *            An {@link OperationContext} object that represents the context for the current operation.
 * @return
 *         An enumerable collection of objects that implement {@link ListBlobItem} and are retrieved lazily.
 * @throws StorageException
 * @throws URISyntaxException
 */
public Iterable<ListBlobItem> listLogBlobs(StorageService service, Date startTime, Date endTime,
        EnumSet<LoggingOperations> operations, BlobListingDetails details, BlobRequestOptions options,
        OperationContext operationContext) throws StorageException, URISyntaxException {
    Utility.assertNotNull("service", service);
    if (operations == null) {
        operations = EnumSet.allOf(LoggingOperations.class);
    }

    if (!(details == null || details.equals(BlobListingDetails.METADATA))) {
        throw new IllegalArgumentException(SR.INVALID_LISTING_DETAILS);
    }

    if (operations.equals(EnumSet.noneOf(LoggingOperations.class))) {
        throw new IllegalArgumentException(SR.INVALID_LOGGING_LEVEL);
    }

    EnumSet<BlobListingDetails> metadataDetails;
    if (details != null
            && (details.equals(BlobListingDetails.METADATA) || !operations.equals(EnumSet
                    .allOf(LoggingOperations.class)))) {
        metadataDetails = EnumSet.of(BlobListingDetails.METADATA);
    }
    else {
        metadataDetails = EnumSet.noneOf(BlobListingDetails.class);
    }

    return new LogBlobIterable(this.getLogDirectory(service), startTime, endTime, operations, metadataDetails,
            options, operationContext);
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:55,代码来源:CloudAnalyticsClient.java

示例3: LogBlobIterator

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
public LogBlobIterator(final CloudBlobDirectory logDirectory, final Date startDate, final Date endDate,
        final EnumSet<LoggingOperations> operations, final EnumSet<BlobListingDetails> details,
        final BlobRequestOptions options, final OperationContext opContext) {
    TimeZone gmtTime = TimeZone.getTimeZone("GMT");
    HOUR_FORMAT.setTimeZone(gmtTime);
    DAY_FORMAT.setTimeZone(gmtTime);
    MONTH_FORMAT.setTimeZone(gmtTime);
    YEAR_FORMAT.setTimeZone(gmtTime);

    this.logDirectory = logDirectory;
    this.operations = operations;
    this.details = details;
    this.opContext = opContext;

    if (options == null) {
        this.options = new BlobRequestOptions();
    }
    else {
        this.options = options;
    }

    if (startDate != null) {
        this.startDate = new GregorianCalendar();
        this.startDate.setTime(startDate);
        this.startDate.add(GregorianCalendar.MINUTE, (-this.startDate.get(GregorianCalendar.MINUTE)));
        this.startDate.setTimeZone(gmtTime);
    }
    if (endDate != null) {
        this.endDate = new GregorianCalendar();
        this.endDate.setTime(endDate);
        this.endDate.setTimeZone(gmtTime);
        this.endPrefix = this.logDirectory.getPrefix() + HOUR_FORMAT.format(this.endDate.getTime());
    }
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:35,代码来源:LogBlobIterator.java

示例4: LogBlobIterable

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
protected LogBlobIterable(final CloudBlobDirectory logDirectory, final Date startTime, final Date endTime,
        final EnumSet<LoggingOperations> operations, final EnumSet<BlobListingDetails> details,
        final BlobRequestOptions options, final OperationContext opContext) {
    this.logDirectory = logDirectory;
    this.startTime = startTime;
    this.endTime = endTime;
    this.operations = operations;
    this.details = details;
    this.options = options;
    this.opContext = opContext;
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:12,代码来源:LogBlobIterable.java

示例5: listBlobs

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
@Override
public Iterable<ListBlobItem> listBlobs(String prefix,
    boolean useFlatBlobListing, EnumSet<BlobListingDetails> listingDetails,
    BlobRequestOptions options, OperationContext opContext)
    throws URISyntaxException, StorageException {
  ArrayList<ListBlobItem> ret = new ArrayList<ListBlobItem>();
  URI searchUri = null;
  if (prefix == null) {
    searchUri = uri;
  } else {
    try {
      searchUri = UriBuilder.fromUri(uri).path(prefix).build();
    } catch (UriBuilderException e) {
      throw new AssertionError("Failed to encode path: " + prefix);
    }
  }

  String fullPrefix = convertUriToDecodedString(searchUri);
  boolean includeMetadata = listingDetails.contains(BlobListingDetails.METADATA);
  HashSet<String> addedDirectories = new HashSet<String>();
  for (InMemoryBlockBlobStore.ListBlobEntry current : backingStore.listBlobs(
      fullPrefix, includeMetadata)) {
    int indexOfSlash = current.getKey().indexOf('/', fullPrefix.length());
    if (useFlatBlobListing || indexOfSlash < 0) {
      if (current.isPageBlob()) {
        ret.add(new MockCloudPageBlobWrapper(
            convertKeyToEncodedUri(current.getKey()),
            current.getMetadata(),
            current.getContentLength()));
      } else {
      ret.add(new MockCloudBlockBlobWrapper(
          convertKeyToEncodedUri(current.getKey()),
          current.getMetadata(),
          current.getContentLength()));
      }
    } else {
      String directoryName = current.getKey().substring(0, indexOfSlash);
      if (!addedDirectories.contains(directoryName)) {
        addedDirectories.add(current.getKey());
        ret.add(new MockCloudBlobDirectoryWrapper(new URI(
            directoryName + "/")));
      }
    }
  }
  return ret;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:47,代码来源:MockStorageInterface.java

示例6: listRootBlobs

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
/**
 * This private method uses the root directory or the original container to
 * list blobs under the directory or container depending on whether the
 * original file system object was constructed with a short- or long-form URI.
 * If the root directory is non-null the URI in the file constructor was in
 * the long form.
 * 
 * @param includeMetadata
 *          if set, the listed items will have their metadata populated
 *          already.
 * 
 * @returns blobItems : iterable collection of blob items.
 * @throws URISyntaxException
 * 
 */
private Iterable<ListBlobItem> listRootBlobs(boolean includeMetadata)
    throws StorageException, URISyntaxException {
  return rootDirectory.listBlobs(
      null, false,
      includeMetadata ?
          EnumSet.of(BlobListingDetails.METADATA) :
            EnumSet.noneOf(BlobListingDetails.class),
      null,
            getInstrumentedContext());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:AzureNativeFileSystemStore.java

示例7: listLogRecords

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
/**
 * Returns an enumerable collection of log records, retrieved lazily.
 * 
 * @param service
 *            A {@link StorageService} enumeration value that indicates which storage service to use.
 * @param startTime
 *            A <code>java.util.Date</code> object representing the start of the time range for which logs should
 *            be retrieved.
 * @param endTime
 *            A <code>java.util.Date</code> object representing the end of the time range for which logs should
 *            be retrieved.
 * @param options
 *            A {@link BlobRequestOptions} object that specifies additional options for the request.
 * @param operationContext
 *            An {@link OperationContext} object that represents the context for the current operation.
 * @return
 *         An enumerable collection of objects that implement {@link ListBlobItem} and are retrieved lazily.
 * @throws StorageException
 * @throws URISyntaxException
 */
public Iterable<LogRecord> listLogRecords(StorageService service, Date startTime, Date endTime,
        BlobRequestOptions options, OperationContext operationContext) throws StorageException, URISyntaxException {
    Utility.assertNotNull("service", service);
    EnumSet<LoggingOperations> operations = EnumSet.allOf(LoggingOperations.class);
    EnumSet<BlobListingDetails> metadataDetails = EnumSet.noneOf(BlobListingDetails.class);
    Iterator<ListBlobItem> blobIterator = new LogBlobIterable(this.getLogDirectory(service), startTime, endTime,
            operations, metadataDetails, options, operationContext).iterator();

    return new LogRecordIterable(blobIterator);
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:31,代码来源:CloudAnalyticsClient.java

示例8: listBlobs

import com.microsoft.azure.storage.blob.BlobListingDetails; //导入依赖的package包/类
/**
 * Returns an enumerable collection of blob items whose names begin with the
 * specified prefix, using the specified flat or hierarchical option,
 * listing details options, request options, and operation context.
 * 
 * @param prefix
 *          A <code>String</code> that represents the prefix of the blob
 *          name.
 * @param useFlatBlobListing
 *          <code>true</code> to indicate that the returned list will be
 *          flat; <code>false</code> to indicate that the returned list will
 *          be hierarchical.
 * @param listingDetails
 *          A <code>java.util.EnumSet</code> object that contains
 *          {@link BlobListingDetails} values that indicate whether
 *          snapshots, metadata, and/or uncommitted blocks are returned.
 *          Committed blocks are always returned.
 * @param options
 *          A {@link BlobRequestOptions} object that specifies any
 *          additional options for the request. Specifying <code>null</code>
 *          will use the default request options from the associated service
 *          client ( {@link CloudBlobClient}).
 * @param opContext
 *          An {@link OperationContext} object that represents the context
 *          for the current operation. This object is used to track requests
 *          to the storage service, and to provide additional runtime
 *          information about the operation.
 * 
 * @return An enumerable collection of {@link ListBlobItem} objects that
 *         represent the block items whose names begin with the specified
 *         prefix in this directory.
 * 
 * @throws StorageException
 *           If a storage service error occurred.
 * @throws URISyntaxException
 *           If the resource URI is invalid.
 */
public abstract Iterable<ListBlobItem> listBlobs(String prefix,
    boolean useFlatBlobListing, EnumSet<BlobListingDetails> listingDetails,
    BlobRequestOptions options, OperationContext opContext)
    throws URISyntaxException, StorageException;
 
开发者ID:naver,项目名称:hadoop,代码行数:42,代码来源:StorageInterface.java


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