Package com.amazonaws.services.glacier.model

Examples of com.amazonaws.services.glacier.model.DescribeVaultResult


    try {
      final CreateVaultRequest createVaultRequest = new CreateVaultRequest(vaultName);
      final CreateVaultResult createVaultResult = client.createVault(createVaultRequest);
      log.info("Vault " + vaultName + " created. " + createVaultResult);
      final DescribeVaultRequest describeVaultRequest = new DescribeVaultRequest().withVaultName(vaultName);
      final DescribeVaultResult describeVaultResult = client.describeVault(describeVaultRequest);
      new VaultPrinter().printVault(describeVaultResult, System.out);
    } catch (final AmazonServiceException e) {
      log.error("Couldn't create vault.");
    } catch (final AmazonClientException e) {
      log.error("Couldn't create vault.");
View Full Code Here


  @Test
  public void testPrintVault() {
    final String linebreak = System.getProperty("line.separator");
    final ByteArrayOutputStream out = new ByteArrayOutputStream();
    final DescribeVaultResult describeVaultResult = new DescribeVaultResult();
    describeVaultResult.setCreationDate(CREATION_DATE);
    describeVaultResult.setLastInventoryDate(INVENTORY_DATE);
    describeVaultResult.setNumberOfArchives(NUMBER_OF_ARCHIVES);
    describeVaultResult.setSizeInBytes(SIZE_IN_BYTES);
    describeVaultResult.setVaultARN(ARN);
    describeVaultResult.setVaultName(VAULT_NAME);
    new VaultPrinter().printVault(describeVaultResult, out);
    assertEquals("CreationDate:\t" + CREATION_DATE + linebreak + "LastInventoryDate:\t" + INVENTORY_DATE + linebreak
        + "NumberOfArchives:\t" + NUMBER_OF_ARCHIVES + linebreak + "SizeInBytes:\t\t" + SIZE_IN_BYTES + linebreak
        + "VaultARN:\t\t" + ARN + linebreak + "VaultName:\t\t" + VAULT_NAME + linebreak, out.toString());
  }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.glacier.model.DescribeVaultResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.