amazon glacier Vault Remover - Java AWS

Java examples for AWS:Glacier

Description

amazon glacier Vault Remover

Demo Code


import java.io.IOException;

import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.PropertiesCredentials;
import com.amazonaws.services.glacier.AmazonGlacierClient;
import com.amazonaws.services.glacier.model.DeleteVaultRequest;


public class VaultRemover {

    public static String vaultName = "GLACIER_TEST";

    public static void main(String[] args) throws IOException {
        ClientConfiguration clientConfiguration = new ClientConfiguration();
        clientConfiguration.setProxyHost("xx.xx.xx.xx");
        clientConfiguration.setProxyPort(0);

        AWSCredentials credentials = new PropertiesCredentials(
                VaultCreator.class
                        .getResourceAsStream("AwsCredentials.properties"));
        AmazonGlacierClient client = new AmazonGlacierClient(credentials,
                clientConfiguration);/*from   w w  w .  j av a2 s  . c o m*/
        client.setEndpoint("https://glacier.ap-northeast-1.amazonaws.com/");
        try {
            DeleteVaultRequest request = new DeleteVaultRequest()
                    .withVaultName(vaultName);
            client.deleteVault(request);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related Tutorials