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


Java S3Objects.inBucket方法代码示例

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


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

示例1: getObjectCount

import com.amazonaws.services.s3.iterable.S3Objects; //导入方法依赖的package包/类
private int getObjectCount(AmazonS3 s3Client, String bucket) {
  int count = 0;
  for(S3ObjectSummary ignored : S3Objects.inBucket(s3Client, bucket)) {
    count++;
  }
  return count;
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:8,代码来源:TestAmazonS3Source2.java

示例2: getObjectCount

import com.amazonaws.services.s3.iterable.S3Objects; //导入方法依赖的package包/类
private int getObjectCount(AmazonS3 s3Client, String bucket) {
  int count = 0;
  for(S3ObjectSummary s : S3Objects.inBucket(s3Client, bucket)) {
    count++;
  }
  return count;
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:8,代码来源:TestAmazonS3SourceDataFormats.java

示例3: createBucket

import com.amazonaws.services.s3.iterable.S3Objects; //导入方法依赖的package包/类
public static void createBucket(AmazonS3 s3client, String bucketName) {
  if(s3client.doesBucketExist(bucketName)) {
    for(S3ObjectSummary s : S3Objects.inBucket(s3client, bucketName)) {
      s3client.deleteObject(bucketName, s.getKey());
    }
    s3client.deleteBucket(bucketName);
  }
  Assert.assertFalse(s3client.doesBucketExist(bucketName));
  // Note that CreateBucketRequest does not specify region. So bucket is
  // bucketName
  s3client.createBucket(new CreateBucketRequest(bucketName));
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:13,代码来源:TestUtil.java

示例4: verifyAndReturnNoOfObjects

import com.amazonaws.services.s3.iterable.S3Objects; //导入方法依赖的package包/类
private int verifyAndReturnNoOfObjects() throws Exception {
  int numberOfObjects = 0;
  for (S3ObjectSummary s3ObjectSummary : S3Objects.inBucket(s3client, TARGET_BUCKET_NAME)) {
    String fileNameOrKey = s3ObjectSummary.getKey();
    if (withFileNamePrefix) {
      //strip out the filePrefix sdc-
      fileNameOrKey = fileNameOrKey.substring(4);
    }
    switch (source) {
      case LOCAL:
        verifyStreamCorrectness(
            new FileInputStream(testDir.getAbsolutePath() + "/" + fileNameOrKey),
            s3client.getObject(TARGET_BUCKET_NAME, s3ObjectSummary.getKey()).getObjectContent()
        );
        break;
      case S3:
        verifyStreamCorrectness(
            s3client.getObject(SOURCE_BUCKET_NAME, fileNameOrKey).getObjectContent(),
            s3client.getObject(TARGET_BUCKET_NAME, s3ObjectSummary.getKey()).getObjectContent()
        );
        break;
    }
    deleteObjectsAfterVerificationInTarget(s3ObjectSummary.getKey());
    numberOfObjects++;
  }
  return numberOfObjects;
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:28,代码来源:TestAmazonS3TargetForWholeFile.java


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