Java 类com.amazonaws.services.s3.model.BucketVersioningConfiguration 实例源码

项目:alfresco-lambda-java-utils    文件:S3CleanerIntegrationTest.java   
@Test
public void testEmptyWithVersions() throws Exception
{
    // enable versioning on the bucket
    SetBucketVersioningConfigurationRequest req = new SetBucketVersioningConfigurationRequest(
                bucketName, new BucketVersioningConfiguration(BucketVersioningConfiguration.ENABLED));
    s3.setBucketVersioningConfiguration(req);

    // create some versions
    createVersionedObjects();

    // empty the bucket of it's contents but leave the bucket itself
    S3Cleaner.emptyBucket(s3, bucketName, false, offlineContext);

    // check the bucket is still present but empty
    assertTrue("Bucket '" + bucketName + "' should still be present", s3.doesBucketExistV2(bucketName));
    ObjectListing objects = s3.listObjects(bucketName);
    assertTrue("Bucket '" + bucketName + "' should be empty", objects.getObjectSummaries().isEmpty());
}
项目:ibm-cos-sdk-java    文件:BucketConfigurationXmlFactory.java   
/**
 * Converts the specified versioning configuration into an XML byte array.
 *
 * @param versioningConfiguration
 *            The configuration to convert.
 *
 * @return The XML byte array representation.
 */
public byte[] convertToXmlByteArray(BucketVersioningConfiguration versioningConfiguration) {
    XmlWriter xml = new XmlWriter();
    xml.start("VersioningConfiguration", "xmlns", Constants.XML_NAMESPACE);
    xml.start("Status").value(versioningConfiguration.getStatus()).end();

    Boolean mfaDeleteEnabled = versioningConfiguration.isMfaDeleteEnabled();
    if (mfaDeleteEnabled != null) {
        if (mfaDeleteEnabled) {
            xml.start("MfaDelete").value("Enabled").end();
        } else {
            xml.start("MfaDelete").value("Disabled").end();
        }
    }

    xml.end();

    return xml.getBytes();
}
项目:ibm-cos-sdk-java    文件:AmazonS3Client.java   
@Override
public void setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest setBucketVersioningConfigurationRequest)
    throws SdkClientException, AmazonServiceException {
    setBucketVersioningConfigurationRequest = beforeClientExecution(setBucketVersioningConfigurationRequest);
    rejectNull(setBucketVersioningConfigurationRequest,
        "The SetBucketVersioningConfigurationRequest object must be specified when setting versioning configuration");

    String bucketName = setBucketVersioningConfigurationRequest.getBucketName();
    BucketVersioningConfiguration versioningConfiguration = setBucketVersioningConfigurationRequest.getVersioningConfiguration();

    rejectNull(bucketName,
        "The bucket name parameter must be specified when setting versioning configuration");
    rejectNull(versioningConfiguration,
        "The bucket versioning parameter must be specified when setting versioning configuration");
    if (versioningConfiguration.isMfaDeleteEnabled() != null) {
        rejectNull(setBucketVersioningConfigurationRequest.getMfa(),
            "The MFA parameter must be specified when changing MFA Delete status in the versioning configuration");
    }

    Request<SetBucketVersioningConfigurationRequest> request = createRequest(bucketName, null, setBucketVersioningConfigurationRequest, HttpMethodName.PUT);
    request.addParameter("versioning", null);

    if (versioningConfiguration.isMfaDeleteEnabled() != null) {
        if (setBucketVersioningConfigurationRequest.getMfa() != null) {
            populateRequestWithMfaDetails(request, setBucketVersioningConfigurationRequest.getMfa());
        }
    }

    byte[] bytes = bucketConfigurationXmlFactory.convertToXmlByteArray(versioningConfiguration);
    request.setContent(new ByteArrayInputStream(bytes));

    invoke(request, voidResponseHandler, bucketName, null);
}
项目:ibm-cos-sdk-java    文件:AmazonS3Client.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest)
        throws SdkClientException, AmazonServiceException {
    getBucketVersioningConfigurationRequest = beforeClientExecution(getBucketVersioningConfigurationRequest);
    rejectNull(getBucketVersioningConfigurationRequest, "The request object parameter getBucketVersioningConfigurationRequest must be specified.");
    String bucketName = getBucketVersioningConfigurationRequest.getBucketName();
    rejectNull(bucketName,
            "The bucket name parameter must be specified when querying versioning configuration");

    Request<GetBucketVersioningConfigurationRequest> request = createRequest(bucketName, null, getBucketVersioningConfigurationRequest, HttpMethodName.GET);
    request.addParameter("versioning", null);

    return invoke(request, new Unmarshallers.BucketVersioningConfigurationUnmarshaller(), bucketName, null);
}
项目:elasticsearch_my    文件:AmazonS3Wrapper.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    return delegate.getBucketVersioningConfiguration(bucketName);
}
项目:elasticsearch_my    文件:AmazonS3Wrapper.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest) throws AmazonClientException, AmazonServiceException {
    return delegate.getBucketVersioningConfiguration(getBucketVersioningConfigurationRequest);
}
项目:syndesis    文件:AmazonS3ClientMock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
项目:syndesis    文件:AmazonS3ClientMock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
项目:syndesis    文件:AmazonS3ClientMock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
项目:connectors    文件:AmazonS3ClientMock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
项目:connectors    文件:AmazonS3ClientMock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
项目:connectors    文件:AmazonS3ClientMock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
项目:ibm-cos-sdk-java    文件:AmazonS3Client.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName)
        throws SdkClientException, AmazonServiceException {
    return getBucketVersioningConfiguration(new GetBucketVersioningConfigurationRequest(bucketName));
}
项目:S3Decorators    文件:S3Decorator.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws SdkClientException, AmazonServiceException {
  return call(() -> getDelegate().getBucketVersioningConfiguration(bucketName));
}
项目:S3Decorators    文件:S3Decorator.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest) throws SdkClientException, AmazonServiceException {
  return call(() -> getDelegate().getBucketVersioningConfiguration(getBucketVersioningConfigurationRequest));
}
项目:aws-codebuild-jenkins-plugin    文件:Validation.java   
public static boolean checkBucketIsVersioned(String bucketName, AWSClientFactory awsClientFactory) {
    final BucketVersioningConfiguration bucketVersioningConfig = awsClientFactory.getS3Client().getBucketVersioningConfiguration(bucketName);
    return bucketVersioningConfig.getStatus().equals(BucketVersioningConfiguration.ENABLED);
}
项目:Camel    文件:AmazonS3ClientMock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws AmazonClientException, AmazonServiceException {
    throw new UnsupportedOperationException();
}
项目:presto    文件:MockAmazonS3.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName)
        throws AmazonClientException
{
    return null;
}
项目:Scribengin    文件:AmazonS3Mock.java   
@Override
public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName)
    throws AmazonClientException, AmazonServiceException {
  // TODO Auto-generated method stub
  return null;
}