aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java b/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java
new file mode 100644
index 000000000..d24be4dcc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/SystemPropertiesWrapper.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright 2019 Nokia
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.utils;
+
+import org.apache.commons.lang.StringUtils;
+
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SystemPropertiesWrapper {
+ public String getProperty(String key) {
+ return SystemProperties.getProperty(key);
+ }
+ public String getOrDefault(String key, String defaultValue) {
+ return StringUtils.defaultIfEmpty(getProperty(key), defaultValue);
+ }
+}