當前位置: 首頁>>代碼示例>>Java>>正文


Java S3BucketVersioningStatus類代碼示例

本文整理匯總了Java中org.jets3t.service.model.S3BucketVersioningStatus的典型用法代碼示例。如果您正苦於以下問題:Java S3BucketVersioningStatus類的具體用法?Java S3BucketVersioningStatus怎麽用?Java S3BucketVersioningStatus使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


S3BucketVersioningStatus類屬於org.jets3t.service.model包,在下文中一共展示了S3BucketVersioningStatus類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getBucketVersioningStatusImpl

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
@Override
protected S3BucketVersioningStatus getBucketVersioningStatusImpl(String bucketName)
    throws S3ServiceException
{
    try {
        if (log.isDebugEnabled()) {
            log.debug( "Checking status of versioning for bucket " + bucketName);
        }
        Map<String, String> requestParams = new HashMap<String, String>();
        requestParams.put("versioning", null);
        HttpResponse response = performRestGet(bucketName, null, requestParams, null);
        return getXmlResponseSaxParser()
            .parseVersioningConfigurationResponse(new HttpMethodReleaseInputStream(response));
    } catch (ServiceException se) {
        throw new S3ServiceException(se);
    }
}
 
開發者ID:guptavishal,項目名稱:jets3t-aws-roles,代碼行數:18,代碼來源:RestS3Service.java

示例2: testEnableVersioning

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
@Test
public void testEnableVersioning() throws IOException, ServiceException {
  S3HdfsPath s3HdfsPath1 = testUtil.setUpS3HdfsPath("versionedBucket");

  // Enable versioning
  S3Bucket retBucket =
      s3Service.createBucket(new S3Bucket(s3HdfsPath1.getBucketName()));

  s3Service.enableBucketVersioning(retBucket.getName());

  // Check versioning is enabled
  S3BucketVersioningStatus bucketVersioningStatus =
      s3Service.getBucketVersioningStatus(retBucket.getName());
  assertEquals(true, bucketVersioningStatus.isVersioningEnabled());

  s3Service.suspendBucketVersioning(retBucket.getName());

  // Check versioning is disabled
  bucketVersioningStatus =
      s3Service.getBucketVersioningStatus(retBucket.getName());
  assertEquals(false, bucketVersioningStatus.isVersioningEnabled());
}
 
開發者ID:WANdisco,項目名稱:s3hdfs,代碼行數:23,代碼來源:TestVersioning.java

示例3: getConfiguration

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
@Override
public VersioningConfiguration getConfiguration(final Path file) throws BackgroundException {
    final Path container = containerService.getContainer(file);
    if(container.isRoot()) {
        return VersioningConfiguration.empty();
    }
    if(cache.containsKey(container)) {
        return cache.get(container);
    }
    try {
        final S3BucketVersioningStatus status
            = session.getClient().getBucketVersioningStatus(container.getName());
        final VersioningConfiguration configuration = new VersioningConfiguration(status.isVersioningEnabled(),
            status.isMultiFactorAuthDeleteRequired());
        cache.put(container, configuration);
        return configuration;
    }
    catch(ServiceException e) {
        try {
            throw new S3ExceptionMappingService().map("Cannot read bucket versioning status", e);
        }
        catch(AccessDeniedException l) {
            log.warn(String.format("Missing permission to read versioning configuration for %s %s", container, e.getMessage()));
            return VersioningConfiguration.empty();
        }
        catch(InteroperabilityException i) {
            log.warn(String.format("Not supported to read versioning configuration for %s %s", container, e.getMessage()));
            return VersioningConfiguration.empty();
        }
    }
}
 
開發者ID:iterate-ch,項目名稱:cyberduck,代碼行數:32,代碼來源:S3VersioningFeature.java

示例4: endElement

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
@Override
public void endElement(String name, String elementText) {
    if (name.equals("Status")) {
        this.status = elementText;
    } else if (name.equals("MfaDelete")) {
        this.mfaStatus = elementText;
    } else if (name.equals("VersioningConfiguration")) {
        this.versioningStatus = new S3BucketVersioningStatus(
            "Enabled".equals(status),
            "Enabled".equals(mfaStatus));
    }
}
 
開發者ID:guptavishal,項目名稱:jets3t-aws-roles,代碼行數:13,代碼來源:XmlResponsesSaxParser.java

示例5: getBucketVersioningStatusImpl

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
protected abstract S3BucketVersioningStatus getBucketVersioningStatusImpl(
String bucketName) throws S3ServiceException;
 
開發者ID:guptavishal,項目名稱:jets3t-aws-roles,代碼行數:3,代碼來源:S3Service.java

示例6: getVersioningStatus

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
public S3BucketVersioningStatus getVersioningStatus() {
    return this.versioningStatus;
}
 
開發者ID:guptavishal,項目名稱:jets3t-aws-roles,代碼行數:4,代碼來源:XmlResponsesSaxParser.java

示例7: parseVersioningConfigurationResponse

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
/**
 * @param inputStream
 *
 * @return
 * true if the bucket has versioning enabled, false otherwise.
 *
 * @throws ServiceException
 */
public S3BucketVersioningStatus parseVersioningConfigurationResponse(
    InputStream inputStream) throws ServiceException
{
    VersioningConfigurationHandler handler = new VersioningConfigurationHandler();
    parseXmlInputStream(handler, inputStream);
    return handler.getVersioningStatus();
}
 
開發者ID:guptavishal,項目名稱:jets3t-aws-roles,代碼行數:16,代碼來源:XmlResponsesSaxParser.java

示例8: getBucketVersioningStatus

import org.jets3t.service.model.S3BucketVersioningStatus; //導入依賴的package包/類
/**
 * Return versioning status of bucket, which reports on whether the given bucket
 * has S3 object versioning enabled and whether multi-factor authentication is
 * required to delete versions.
 *
 * @param bucketName
 * the name of the bucket.
 * @return
 * versioning status of bucket
 * @throws S3ServiceException
 */
public S3BucketVersioningStatus getBucketVersioningStatus(String bucketName)
    throws S3ServiceException
{
    return getBucketVersioningStatusImpl(bucketName);
}
 
開發者ID:guptavishal,項目名稱:jets3t-aws-roles,代碼行數:17,代碼來源:S3Service.java


注:本文中的org.jets3t.service.model.S3BucketVersioningStatus類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。