How to read config.properties in Java:
Create a file with the config keys and values:
Sample config.properties files:
To read from this file.
Properties prop = new Properties();
InputStream input = null;
String configFilename = "Specify the file location / complete file path";
input = new FileInputStream(configFilename);
prop.load(input);
bucketName = prop.getProperty("propertyname");
regionName = prop.getProperty("regionName");
accessKeyId = prop.getProperty("accessKeyId");
secretAccessKey = prop.getProperty("secretAccessKey");
Comments
Post a Comment