Do not show exception for config.properties

This commit is contained in:
bancika
2012-10-01 08:14:16 +00:00
parent 39efdca0b8
commit 2993900cc6
@@ -1,5 +1,6 @@
package org.diylc; package org.diylc;
import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.net.URL; import java.net.URL;
import java.util.Arrays; import java.util.Arrays;
@@ -63,9 +64,9 @@ public class DIYLCStarter {
int response = JOptionPane int response = JOptionPane
.showConfirmDialog( .showConfirmDialog(
null, null,
"It is not recommended to run DIYLC by clicking on the diylc.jar file.\n" + "It is not recommended to run DIYLC by clicking on the diylc.jar file.\n"
"Please use diylc.exe on Windows or run.sh on OSX/Linux to ensure the best\n" + + "Please use diylc.exe on Windows or run.sh on OSX/Linux to ensure the best\n"
"performance and reliability. Do you want to continue?", + "performance and reliability. Do you want to continue?",
"DIYLC", JOptionPane.YES_NO_OPTION, "DIYLC", JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE); JOptionPane.WARNING_MESSAGE);
if (response != JOptionPane.YES_OPTION) { if (response != JOptionPane.YES_OPTION) {
@@ -93,8 +94,11 @@ public class DIYLCStarter {
properties = new Properties(); properties = new Properties();
try { try {
LOG.info("Injecting default properties."); LOG.info("Injecting default properties.");
properties.load(new FileInputStream("config.properties")); File f = new File("config.properties");
if (f.exists()) {
properties.load(new FileInputStream(f));
PropertyInjector.injectProperties(properties); PropertyInjector.injectProperties(properties);
}
} catch (Exception e) { } catch (Exception e) {
LOG.error("Could not read config.properties file", e); LOG.error("Could not read config.properties file", e);
} }