mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: add OpenviduConfig#asOptionalStringAndNullIfBlank
parent
5ea339c3cd
commit
7470261345
|
@ -820,9 +820,10 @@ public class OpenviduConfig {
|
||||||
protected String asOptionalURL(String property) {
|
protected String asOptionalURL(String property) {
|
||||||
String optionalUrl = getValue(property);
|
String optionalUrl = getValue(property);
|
||||||
try {
|
try {
|
||||||
if (!optionalUrl.isEmpty()) {
|
if (optionalUrl.isBlank()) {
|
||||||
checkUrl(optionalUrl);
|
return null;
|
||||||
}
|
}
|
||||||
|
checkUrl(optionalUrl);
|
||||||
return optionalUrl;
|
return optionalUrl;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
addError(property, "Is not a valid URL. " + e.getMessage());
|
addError(property, "Is not a valid URL. " + e.getMessage());
|
||||||
|
@ -855,6 +856,14 @@ public class OpenviduConfig {
|
||||||
return getValue(property);
|
return getValue(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String asOptionalStringAndNullIfBlank(String property) {
|
||||||
|
String value = getValue(property);
|
||||||
|
if (value != null && value.isBlank()) {
|
||||||
|
value = null;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean asBoolean(String property) {
|
protected boolean asBoolean(String property) {
|
||||||
String value = getValue(property);
|
String value = getValue(property);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
|
|
Loading…
Reference in New Issue