mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-18 16:17:00 +07:00
34 lines
862 B
Java
34 lines
862 B
Java
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |