Managing AWS credentials separately and accessing those in java code

Viewed 6164

I am using java to upload and download files from s3. My problem is that I can't check in the code along with the secret and access key to public but the code has to checked in to a public environment. How can I manage my credentials separately and access only its references in my code?

the code I used is

String awsAccessKey = "YOUR_AWS_ACCESS_KEY";
String awsSecretKey = "YOUR_AWS_SECRET_KEY";
AWSCredentials awsCredentials = 
    new AWSCredentials(awsAccessKey, awsSecretKey);

I want the credentials manager to be platform independent.

2 Answers
Related