blob: ac03eea543553fb9e81c1e70e945177169a38fb0 [file] [log] [blame]
public class Test {
public void foo() {
Properties properties = new Properties();
InputStream inStream = null;
try {
removeCustomPrefixFromProperties(propertiesFile);
inStream = new FileInputStream(propertiesFile);
properties.load(inStream);
Enumeration<?> propertyNames = properties.propertyNames();
while (propertyNames.hasMoreElements()) {
String name = (String) propertyNames.nextElement();
setValue(name, properties.getProperty(name));
}
} catch (FileNotFoundException e) {
System.err.println(e.getMessage());
System.exit(-1);
}
catch (IOException e) {
LOG.error(e.getMessage(), e);
} finally {
if (inStream != null) {
try {
inStream.close();
} catch (IOException e) {
LOG.info(e);
}
}
}
}
}