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

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

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

Region.toString介绍

暂无

代码示例

代码示例来源:origin: aws/aws-sdk-java

/**
 * Constructs a new {@link CreateBucketRequest},
 * ready to be executed to create the
 * specified bucket in the specified region.
 *
 * @param bucketName
 *            The name of the Amazon S3 bucket to create.
 * @param region
 *            The region in which to create this bucket. This must match the
 *            region of the endpoint the client is configured against unless
 *            the client is configured against the US Standard endpoint
 *            (s3.amazonaws.com).
 *
 * @see CreateBucketRequest#CreateBucketRequest(String)
 * @see CreateBucketRequest#CreateBucketRequest(String, String)
 */
public CreateBucketRequest(String bucketName, Region region) {
  this(bucketName, region.toString());
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Constructs a new {@link CreateBucketRequest}, ready to be executed to
 * create the specified bucket in the specified region.
 *
 * @param bucketName The name of the Amazon S3 bucket to create.
 * @param region The region in which to create this bucket.
 * @see CreateBucketRequest#CreateBucketRequest(String)
 * @see CreateBucketRequest#CreateBucketRequest(String, String)
 */
public CreateBucketRequest(String bucketName, Region region) {
  this(bucketName, region.toString());
}

代码示例来源:origin: aws/aws-sdk-java

if (requestRegion != null && !StringUtils.upperCase(requestRegion).equals(Region.US_Standard.toString())) {
  XmlWriter xml = new XmlWriter();
  xml.start("CreateBucketConfiguration", "xmlns", Constants.XML_NAMESPACE);

代码示例来源:origin: aws-amplify/aws-sdk-android

@Test
public void testRegionEnumeration() {
  assertEquals(Region.EU_Ireland, Region.fromValue(Region.EU_Ireland.toString()));
  assertEquals(Region.US_Standard, Region.fromValue(Region.US_Standard.toString()));
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-s3

/**
 * Constructs a new {@link CreateBucketRequest}, ready to be executed to
 * create the specified bucket in the specified region.
 *
 * @param bucketName The name of the Amazon S3 bucket to create.
 * @param region The region in which to create this bucket.
 * @see CreateBucketRequest#CreateBucketRequest(String)
 * @see CreateBucketRequest#CreateBucketRequest(String, String)
 */
public CreateBucketRequest(String bucketName, Region region) {
  this(bucketName, region.toString());
}

代码示例来源:origin: aws-amplify/aws-sdk-android

if (region != null && !StringUtils.upperCase(region).equals(Region.US_Standard.toString())) {
  final XmlWriter xml = new XmlWriter();
  xml.start("CreateBucketConfiguration", "xmlns", Constants.XML_NAMESPACE);

代码示例来源:origin: Nextdoor/bender

/**
 * Constructs a new {@link CreateBucketRequest},
 * ready to be executed to create the
 * specified bucket in the specified region.
 *
 * @param bucketName
 *            The name of the Amazon S3 bucket to create.
 * @param region
 *            The region in which to create this bucket. This must match the
 *            region of the endpoint the client is configured against unless
 *            the client is configured against the US Standard endpoint
 *            (s3.amazonaws.com).
 *
 * @see CreateBucketRequest#CreateBucketRequest(String)
 * @see CreateBucketRequest#CreateBucketRequest(String, String)
 */
public CreateBucketRequest(String bucketName, Region region) {
  this(bucketName, region.toString());
}

代码示例来源:origin: classmethod/gradle-aws-plugin

private String getAwsRegionName(final String region) {
  try {
    return Region.fromValue(region).toString();
  } catch (IllegalArgumentException e) {
    throw new GradleException(e.getMessage(), e);
  }
}

代码示例来源:origin: takipi/aws-s3-speed

private static boolean doPutObject(Region region, String bucket, String key, InputStream is, ObjectMetadata metaData)
{
  try
    {
      String regionName = "";
      if (region.toString() != null) {
        regionName = region.toString();
      } else {
        regionName = "us-east-1";
      }
      logger.debug("Setregion: {}", regionName);
      // need to set the region for "eu-central-1" region to work
      // this enables V4 signing
      // careful, this is not thread-safe!
      s3client.setRegion(RegionUtils.getRegion(regionName));
      logger.debug("PUT object to S3 bucket: {}", bucket);
      s3client.putObject(bucket, key, is, metaData);
      return true;
    }
  catch (Exception e)
    {
      logger.error("Error putting object", e);
      return false;
    }
}

代码示例来源:origin: takipi/aws-s3-speed

private static void doDeleteObject(Region region, String bucket, String key)
  {
    try
    {
      String regionName = "";
      if (region.toString() != null) {
        regionName = region.toString();
      } else {
        regionName = "us-east-1";
      }
      logger.debug("Setregion: {}", regionName);
      // need to set the region for "eu-central-1" region to work
      // this enables V4 signing
      // careful, this is not thread-safe!
      s3client.setRegion(RegionUtils.getRegion(regionName));
      logger.debug("DELETE object from S3 bucket: {}", bucket);
      s3client.deleteObject(bucket, key);
    }
    catch (Exception e)
    {
      logger.error("Error deleting object", e);
      return;
    }
  }
}

代码示例来源:origin: takipi/aws-s3-speed

if (region.toString() != null) {
  regionName = region.toString();
} else {
  regionName = "us-east-1";

代码示例来源:origin: takipi/aws-s3-speed

if (region.toString() != null) {
  regionName = region.toString();
} else {
  regionName = "us-east-1";

代码示例来源:origin: takipi/aws-s3-speed

if (region.toString() != null) {
  regionName = region.toString();
} else {
  regionName = "us-east-1";

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-aws-ext

if (Utils.DEFAULT_AWS_BUCKET_REGION.equals(region)) {
  s3Region = Region.US_Standard;
} else if (Region.EU_Ireland.toString().equals(region)) {
  s3Region = Region.EU_Ireland;
} else {

代码示例来源: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;
}

代码示例来源:origin: apache/jackrabbit

} else if (Region.EU_Ireland.toString().equals(region)) {
  endpoint = "s3-eu-west-1" + DOT + AWSDOTCOM;
} else {

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-aws-ext

} else if (Region.EU_Ireland.toString().equals(region)) {
  endpoint = "s3-eu-west-1" + DOT + AWSDOTCOM;
} else {

代码示例来源:origin: com.amazonaws/aws-android-sdk-s3

if (region != null && !StringUtils.upperCase(region).equals(Region.US_Standard.toString())) {
  final XmlWriter xml = new XmlWriter();
  xml.start("CreateBucketConfiguration", "xmlns", Constants.XML_NAMESPACE);

代码示例来源:origin: Nextdoor/bender

if (requestRegion != null && !StringUtils.upperCase(requestRegion).equals(Region.US_Standard.toString())) {
  XmlWriter xml = new XmlWriter();
  xml.start("CreateBucketConfiguration", "xmlns", Constants.XML_NAMESPACE);

相关文章