use of com.amazonaws.services.glacier.AmazonGlacier in project aws-doc-sdk-examples by awsdocs.
the class ListVaults method main.
public static void main(String[] args) {
final AmazonGlacier glacier = AmazonGlacierClientBuilder.defaultClient();
ListVaultsRequest request = new ListVaultsRequest();
boolean list_complete = false;
int total_vaults = 0;
System.out.println("Your Amazon Glacier vaults:");
while (!list_complete) {
ListVaultsResult result = glacier.listVaults(request);
List<DescribeVaultOutput> vault_list = result.getVaultList();
for (DescribeVaultOutput v : vault_list) {
total_vaults += 1;
System.out.println("* " + v.getVaultName());
}
// check for further results.
String marker = result.getMarker();
if (marker != null) {
request.setMarker(marker);
} else {
list_complete = true;
}
}
if (total_vaults == 0) {
System.out.println(" no vaults found.");
}
}
Aggregations