Skip to content

Instantly share code, notes, and snippets.

@abh1nav
Created February 1, 2013 07:31
Show Gist options
  • Save abh1nav/4689919 to your computer and use it in GitHub Desktop.
Save abh1nav/4689919 to your computer and use it in GitHub Desktop.
Load AWS credentials from a resource
public class Util {
public static PropertiesCredentials getAwsCredentials() {
PropertiesCredentials creds = null;
try {
creds = new PropertiesCredentials(
Util.class.getResourceAsStream(
"/AwsCredentials.properties"));
}
catch(Exception e) {
throw new RuntimeException("Could not load AwsCredentials", e);
}
return creds;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment