com.amazonaws.services.s3.model.Region.equals()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(71)

本文整理了Java中com.amazonaws.services.s3.model.Region.equals方法的一些代码示例,展示了Region.equals的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Region.equals方法的具体详情如下:
包路径:com.amazonaws.services.s3.model.Region
类名称:Region
方法名:equals

Region.equals介绍

暂无

代码示例

代码示例来源:origin: aimmac23/selenium-video-node

@Override
  public Map<String, Object> additionalInformation() {
    // AWS S3 endpoint for US standard does not have the region identifier
    // in it for legacy reasons. All other regions contain the identifier in the URI.
    // Examples:
    // 1. eu-west-1
    //    https://s3-eu-west-1.amazonaws.com/<bucketName>/<key>
    // 2. us-east-1 (default)
    //    https://<bucketName>.amazonaws.com/<key>
    String endpointUri = String.format("https://%s.s3.amazonaws.com/%s", bucketName, videoFileName);
    if (!s3Region.equals(Region.US_Standard)) {
      endpointUri = String.format("https://s3-%s.amazonaws.com/%s/%s", s3Region, bucketName, videoFileName);
    }

    return new HashMap<String, Object>(Collections.singletonMap("path", endpointUri));
  }
}

代码示例来源:origin: HotelsDotCom/circus-train

private String regionForUri(AmazonS3 client, AmazonS3URI uri) {
 String bucketRegion = client.getBucketLocation(uri.getBucket());
 Region region = Region.fromValue(bucketRegion);
 // S3 doesn't have a US East 1 region, US East 1 is really the region
 // US Standard. US Standard places the data in either an east coast
 // or west coast data center geographically closest to you.
 // SigV4 requires you to mention a region while signing a request
 // and for the S3's US standard endpoints the value to be used is "us-east-1"
 // US West 1 has an endpoint and so is treated as a stand alone region,
 // US East 1 doesn't and so is bundled into US Standard
 if (region.equals(Region.US_Standard)) {
  bucketRegion = "us-east-1";
 } else {
  bucketRegion = region.toString();
 }
 return bucketRegion;
}

代码示例来源:origin: com.hotels/circus-train-s3-s3-copier

private String regionForUri(AmazonS3 client, AmazonS3URI uri) {
 String bucketRegion = client.getBucketLocation(uri.getBucket());
 Region region = Region.fromValue(bucketRegion);
 // S3 doesn't have a US East 1 region, US East 1 is really the region
 // US Standard. US Standard places the data in either an east coast
 // or west coast data center geographically closest to you.
 // SigV4 requires you to mention a region while signing a request
 // and for the S3's US standard endpoints the value to be used is "us-east-1"
 // US West 1 has an endpoint and so is treated as a stand alone region,
 // US East 1 doesn't and so is bundled into US Standard
 if (region.equals(Region.US_Standard)) {
  bucketRegion = "us-east-1";
 } else {
  bucketRegion = region.toString();
 }
 return bucketRegion;
}

相关文章