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


Java DeleteBucketRequest类代码示例

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


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

示例1: main

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	DeleteBucketRequest deleteBucketRequest=new DeleteBucketRequest(AWSResources.S3_BUCKET_NAME);
	if(AWSResources.S3.doesBucketExist(AWSResources.S3_BUCKET_NAME))
		try {
				AWSResources.S3.deleteBucket(deleteBucketRequest);
				System.out.println("Bucket Deleted...");
		}
	catch (AmazonS3Exception ex) {
		if(!ex.getErrorCode().equals("BucketNotEmpty"))
			throw ex;
	}
	//List<KeyVersion> keys = new ArrayList<KeyVersion>();
	for(S3ObjectSummary obj : S3Objects.withPrefix(AWSResources.S3, AWSResources.S3_BUCKET_NAME, "")) {
    // Add the keys to our list of object.
    AWSResources.S3.deleteObject(AWSResources.S3_BUCKET_NAME, obj.getKey());
	}
	//DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(AWSResources.S3_BUCKET_NAME);
	//AWSResources.S3.deleteObjects(deleteObjectsRequest);
	AWSResources.S3.deleteBucket(deleteBucketRequest);
	if(!AWSResources.S3.doesBucketExist(AWSResources.S3_BUCKET_NAME))
		System.out.println("Deleted");
}
 
开发者ID:snehangshuk,项目名称:aws,代码行数:23,代码来源:DeleteObject.java

示例2: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
@Override
public void deleteBucket(DeleteBucketRequest deleteBucketRequest)
        throws SdkClientException, AmazonServiceException {
    deleteBucketRequest = beforeClientExecution(deleteBucketRequest);
    rejectNull(deleteBucketRequest,
            "The DeleteBucketRequest parameter must be specified when deleting a bucket");

    String bucketName = deleteBucketRequest.getBucketName();
    rejectNull(bucketName,
            "The bucket name parameter must be specified when deleting a bucket");

    Request<DeleteBucketRequest> request = createRequest(bucketName, null, deleteBucketRequest, HttpMethodName.DELETE);
    invoke(request, voidResponseHandler, bucketName, null);
    bucketRegionCache.remove(bucketName);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:16,代码来源:AmazonS3Client.java

示例3: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
public void deleteBucket(String bucketName, boolean recursive) throws AmazonClientException, AmazonServiceException {
  if(recursive) {
    deleteKeyWithPrefix(bucketName, "");
  }
  DeleteBucketRequest request = new DeleteBucketRequest(bucketName) ;
  s3Client.deleteBucket(request);
}
 
开发者ID:DemandCube,项目名称:Scribengin,代码行数:8,代码来源:S3Client.java

示例4: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
@Override
public void deleteBucket(DeleteBucketRequest deleteBucketRequest) throws AmazonClientException, AmazonServiceException {
    delegate.deleteBucket(deleteBucketRequest);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AmazonS3Wrapper.java

示例5: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
@Override
public void deleteBucket(DeleteBucketRequest deleteBucketRequest) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:5,代码来源:AmazonS3ClientMock.java

示例6: cleanUp

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
@AfterClass
private void cleanUp() throws Exception {
    DeleteBucketRequest deleteBucketRequest = new DeleteBucketRequest(bucketName);

    s3Client.deleteBucket(deleteBucketRequest);
}
 
开发者ID:awslabs,项目名称:aws-photosharing-example,代码行数:7,代码来源:ContentHelperTest.java

示例7: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
@Override
public void deleteBucket(DeleteBucketRequest deleteBucketRequest) throws SdkClientException, AmazonServiceException {
  run(() -> getDelegate().deleteBucket(deleteBucketRequest));
}
 
开发者ID:HubSpot,项目名称:S3Decorators,代码行数:5,代码来源:S3Decorator.java

示例8: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
@Override
public void deleteBucket(DeleteBucketRequest deleteBucketRequest)
        throws AmazonClientException
{
}
 
开发者ID:y-lan,项目名称:presto,代码行数:6,代码来源:MockAmazonS3.java

示例9: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
String deleteBucket(String access_key, String secret_key,
        String bucket, String endpoint
) {
    String message = null;
    AWSCredentials credentials = new BasicAWSCredentials(access_key, secret_key);
    AmazonS3 s3Client = new AmazonS3Client(credentials,
            new ClientConfiguration());
    if (endpoint.contains("amazonaws.com")) {
        String aws_endpoint = s3Client.getBucketLocation(new GetBucketLocationRequest(bucket));
        if (aws_endpoint.contains("US")) {
            s3Client.setEndpoint("https://s3.amazonaws.com");
        } else if (aws_endpoint.contains("us-west")) {
            s3Client.setEndpoint("https://s3-" + aws_endpoint + ".amazonaws.com");
        } else if (aws_endpoint.contains("eu-west")) {
            s3Client.setEndpoint("https://s3-" + aws_endpoint + ".amazonaws.com");
        } else if (aws_endpoint.contains("ap-")) {
            s3Client.setEndpoint("https://s3-" + aws_endpoint + ".amazonaws.com");
        } else if (aws_endpoint.contains("sa-east-1")) {
            s3Client.setEndpoint("https://s3-" + aws_endpoint + ".amazonaws.com");
        } else {
            s3Client.setEndpoint("https://s3." + aws_endpoint + ".amazonaws.com");
        }
    } else {
        s3Client.setS3ClientOptions(S3ClientOptions.builder().setPathStyleAccess(true).build());
        s3Client.setEndpoint(endpoint);
    }
    message = ("\nDeleting bucket: " + bucket);
    try {
        s3Client.deleteBucket(new DeleteBucketRequest(bucket));
    } catch (Exception Delete) {
        if (terminal) {
            System.out.print("\n\n\n" + Delete.getMessage() + "\n\n\n");
        } else {
            message = message + "\n" + Delete.getMessage();
        }
    }

    if (message == null) {
        message = "\nDelete operation failed.";
    }

    return message;
}
 
开发者ID:rusher81572,项目名称:cloudExplorer,代码行数:44,代码来源:BucketClass.java

示例10: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
@Override
public void deleteBucket(DeleteBucketRequest deleteBucketRequest) throws AmazonClientException,
    AmazonServiceException {
  // TODO Auto-generated method stub

}
 
开发者ID:DemandCube,项目名称:Scribengin,代码行数:7,代码来源:AmazonS3Mock.java

示例11: deleteBucket

import com.amazonaws.services.s3.model.DeleteBucketRequest; //导入依赖的package包/类
/**
 * delete bucket
 * @param region
 * @param tableName
 * @throws ConfigException
 */
public static void deleteBucket(String region, String tableName) throws ConfigException {
    AmazonS3Client client = getClient(region);
    client.deleteBucket(new DeleteBucketRequest(tableName));
}
 
开发者ID:mychaelstyle,项目名称:s3tool,代码行数:11,代码来源:Transporter.java


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