allow to prohibit network access from within code
This commit is contained in:
parent
81b3295f3c
commit
580079f26d
|
@ -16,6 +16,7 @@ public class FhirSettings {
|
||||||
|
|
||||||
public static final String FHIR_SETTINGS_PATH = "fhir.settings.path";
|
public static final String FHIR_SETTINGS_PATH = "fhir.settings.path";
|
||||||
private static String explicitFilePath = null;
|
private static String explicitFilePath = null;
|
||||||
|
private static Boolean prohibitNetworkAccess;
|
||||||
|
|
||||||
public static void setExplicitFilePath(String explicitFilePath) {
|
public static void setExplicitFilePath(String explicitFilePath) {
|
||||||
if (instance != null) {
|
if (instance != null) {
|
||||||
|
@ -114,14 +115,27 @@ public class FhirSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasProhibitNetworkAccess() {
|
public static boolean hasProhibitNetworkAccess() {
|
||||||
|
if (prohibitNetworkAccess != null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
getInstance();
|
getInstance();
|
||||||
return instance.fhirSettings.getProhibitNetworkAccess() != null; }
|
return instance.fhirSettings.getProhibitNetworkAccess() != null;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isProhibitNetworkAccess() {
|
public static boolean isProhibitNetworkAccess() {
|
||||||
|
if (prohibitNetworkAccess != null) {
|
||||||
|
return prohibitNetworkAccess;
|
||||||
|
}
|
||||||
getInstance();
|
getInstance();
|
||||||
return instance.fhirSettings.getProhibitNetworkAccess() == null
|
return instance.fhirSettings.getProhibitNetworkAccess() == null
|
||||||
? false
|
? false
|
||||||
: instance.fhirSettings.getProhibitNetworkAccess(); }
|
: instance.fhirSettings.getProhibitNetworkAccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setProhibitNetworkAccess(boolean value) {
|
||||||
|
prohibitNetworkAccess = value;
|
||||||
|
}
|
||||||
|
|
||||||
private static FhirSettings instance = null;
|
private static FhirSettings instance = null;
|
||||||
|
|
||||||
private static FhirSettings getInstance() {
|
private static FhirSettings getInstance() {
|
||||||
|
|
Loading…
Reference in New Issue