Skip to content

Commit b631d05

Browse files
committed
Refactor the calls to System.getProperty()
- first try using the value of tcmsConfigPath - if that's missing then default to ~/.tcms.conf
1 parent 5e7105b commit b631d05

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/org/kiwitcms/java/config/Config.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.apache.commons.configuration2.builder.fluent.Configurations;
99
import org.apache.commons.configuration2.ex.ConfigurationException;
1010

11-
import org.apache.commons.lang3.StringUtils;
1211
import org.ini4j.Ini;
1312
import org.ini4j.IniPreferences;
1413

@@ -27,10 +26,10 @@ public class Config {
2726

2827
private Config() {
2928
try {
30-
String config_path = System.getProperty("user.home") + "/.tcms.conf");
31-
if (!StringUtils.isBlank(System.getProperty("tcmsConfigPath"))) {
32-
config_path = System.getProperty("tcmsConfigPath");
33-
}
29+
String config_path = System.getProperty(
30+
"tcmsConfigPath",
31+
System.getProperty("user.home") + "/.tcms.conf"
32+
);
3433
config = new IniPreferences(new Ini(new File(config_path)));
3534
} catch (java.io.IOException fnfe) {
3635
fnfe.printStackTrace();

0 commit comments

Comments
 (0)