mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Do not show exception for config.properties
This commit is contained in:
+10
-6
@@ -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;
|
||||||
@@ -57,15 +58,15 @@ public class DIYLCStarter {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Could not set Look&Feel", e);
|
LOG.error("Could not set Look&Feel", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
String val = System.getProperty(SCRIPT_RUN);
|
String val = System.getProperty(SCRIPT_RUN);
|
||||||
if (!"true".equals(val)) {
|
if (!"true".equals(val)) {
|
||||||
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");
|
||||||
PropertyInjector.injectProperties(properties);
|
if (f.exists()) {
|
||||||
|
properties.load(new FileInputStream(f));
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user