Java
Chilkat2 Java
S3 Create Bucket
See more Amazon S3 Examples
Demonstrates how to create a new bucket.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Http;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Http http = new Http();
// Insert your access key here:
http.setAwsAccessKey("ABQXXABC83ABCDEFVQXX");
// Insert your secret key here:
http.setAwsSecretKey("XXXXYYYYabcdABCD12345678xxxxyyyyzzzz");
try {
http.s3CreateBucket("chilkattestbucket");
System.out.println("Bucket created.");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
}
}
}