diff options
-rw-r--r-- | sdc-workflow-designer-server/pom.xml | 28 | ||||
-rw-r--r-- | sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java | 43 |
2 files changed, 61 insertions, 10 deletions
diff --git a/sdc-workflow-designer-server/pom.xml b/sdc-workflow-designer-server/pom.xml index 7fc28c72..a04b5c94 100644 --- a/sdc-workflow-designer-server/pom.xml +++ b/sdc-workflow-designer-server/pom.xml @@ -16,20 +16,28 @@ limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> + <parent> <groupId>org.onap.sdc.sdc-workflow-designer</groupId> <artifactId>sdc-workflow-designer</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>sdc-workflow-designer-server</artifactId> - <name>sdc-workflow-designer-server</name> - <version>1.0.0-SNAPSHOT</version> - <packaging>jar</packaging> - - + <modelVersion>4.0.0</modelVersion> + <artifactId>sdc-workflow-designer-server</artifactId> + <name>sdc-workflow-designer-server</name> + <version>1.0.0-SNAPSHOT</version> + <packaging>jar</packaging> + <properties> + <slf4j.version>1.7.25</slf4j.version> + </properties> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + </dependencies> </project> diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java new file mode 100644 index 00000000..5a5b54a7 --- /dev/null +++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java @@ -0,0 +1,43 @@ +package org.onap.sdc.workflowdesigner.config;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Config {
+ private static Logger log = LoggerFactory.getLogger(Config.class);
+ private static String configFilePath = "bpmn.config.properties";
+ public static String HANDLER_ClASS = "handlerClass";
+ public static String TEMPLATE_PATH = "templatePath";
+
+ public static Properties PROPERTIES = load();
+
+ public static Properties load() {
+ Properties properties = new Properties();
+ InputStream in = null;
+ try {
+ in = Config.class.getClassLoader().getResourceAsStream(configFilePath);
+ properties.load(in);
+ } catch (FileNotFoundException e) {
+ log.error(configFilePath, e);
+ } catch (IOException e) {
+ log.error(configFilePath, e);
+ } catch (Exception e) {
+ log.error(configFilePath, e);
+ } finally {
+ if(in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ log.error(configFilePath, e);
+ }
+ }
+ }
+
+ return properties;
+ }
+}
|