It is very important to know and understand the API's provided from AWS.
AWS has provided some API's to connect to it's S3 bucket. We will using this to get the connection to amazon s3.
Below is direct code snippet which will give the created amazon s3 client object.
public AmazonS3 getAWSClient() {
AmazonS3 s3Client = null;
BasicAWSCredentials awsCredential = new BasicAWSCredentials(
"ACCESS KEY", "SECRET ACCESS KEY");
ClientConfiguration clientConfig = new ClientConfiguration();
clientConfig.setProtocol(Protocol.HTTPS);
s3Client = new AmazonS3Client(awsCredential, clientConfig);
return s3Client;
}