*/
package org.sonar.process;
+import org.apache.commons.lang.StringUtils;
+
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import java.io.File;
}
return this;
}
+
+ public void setDefault(String key, String value) {
+ String s = properties.getProperty(key);
+ if (StringUtils.isBlank(s)) {
+ properties.setProperty(key, value);
+ }
+ }
}
// init string properties
for (Map.Entry<String, String> entry : defaults().entrySet()) {
- props.set(entry.getKey(), entry.getValue());
+ props.setDefault(entry.getKey(), entry.getValue());
}
// init ports