System.out.println("Usage: bucket-list -prefix=<prefix> -delimiter=<delimiter> -marker=<Marker> -max=<max items to return> <bucket name>");
System.exit(0);
}
try {
ListBucket request = new ListBucket();
Map<String, String> params = getNamedParameters(args);
request.setBucket(args[args.length - 1]);
request.setCredential("TODO");
if(params.get("prefix") != null)
request.setPrefix(params.get("prefix"));
if(params.get("delimiter") != null)
request.setDelimiter(params.get("delimiter"));
if(params.get("marker") != null)
request.setMarker(params.get("marker"));
if(params.get("max") != null) {
try {
int maxKeys = Integer.parseInt(params.get("max"));
request.setMaxKeys(maxKeys);
} catch(Exception e){
System.out.println("-max parameter should be a numeric value");
}
}
request.setAWSAccessKeyId("TODO");
request.setCredential("TODO");
request.setSignature("TODO");
request.setTimestamp(Calendar.getInstance());
ListBucketResponse response = serviceStub.listBucket(request);
ListBucketResult result = response.getListBucketResponse();
System.out.println("\tContent of Bucket " + result.getName());
System.out.println("\tListing with prefix: " + result.getPrefix() + ", delimiter: "