From 03177c7c79176ab93d1be89762fc5841b33e4691 Mon Sep 17 00:00:00 2001 From: Carsten Lund Date: Sat, 11 Mar 2017 13:00:55 +0000 Subject: [DCAE-15] Changes related to version 1.1 See Jira for details Change-Id: I4e614cda9db201a72f831bdaa81ac2431fd43722 Signed-off-by: Carsten Lund --- .gitreview | 2 +- ncomp-utils-java-extra/pom.xml | 22 +++++++++--------- ncomp-utils-java/.classpath | 10 -------- .../.settings/org.eclipse.core.resources.prefs | 3 --- ncomp-utils-java/pom.xml | 27 +++++++++++++--------- .../ncomp/webservice/utils/FileUtils.java | 2 +- .../ncomp/webservice/utils/JsonUtils.java | 20 ++++++++++++++++ ncomp-utils-journaling/pom.xml | 22 +++++++++--------- pom.xml | 8 +++---- version.properties | 2 +- 10 files changed, 65 insertions(+), 53 deletions(-) diff --git a/.gitreview b/.gitreview index 80f52e7..eecb719 100644 --- a/.gitreview +++ b/.gitreview @@ -1,4 +1,4 @@ [gerrit] -host=gerrit.openecomp.org +host=gerrit.onap.org port=29418 project=ncomp/utils.git diff --git a/ncomp-utils-java-extra/pom.xml b/ncomp-utils-java-extra/pom.xml index 821c7a3..5594b84 100644 --- a/ncomp-utils-java-extra/pom.xml +++ b/ncomp-utils-java-extra/pom.xml @@ -1,20 +1,20 @@ - + + 4.0.0 org.openecomp.ncomp.utils ncomp-utils-java-extra - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT UTF-8 1.7 1.7 - https://nexus.openecomp.org/content/repositories/releases/ - https://nexus.openecomp.org/content/repositories/snapshots/ - https://nexus.openecomp.org + https://nexus.onap.org/content/repositories/releases/ + https://nexus.onap.org/content/repositories/snapshots/ + https://nexus.onap.org ecomp-staging 176c31dfe190a - + https://nexus.onap.org @@ -48,8 +48,8 @@ maven-compiler-plugin 3.1 - - + + @@ -115,8 +115,8 @@ ${openecomp.nexus.snapshots} - dcae-javadoc - ${site.urlroot}/${project.artifactId}/${project.version}/ + ecomp-site + dav:${nexusproxy}/content/sites/site/org/openecomp/ncomp/utils/${project.artifactId}/${project.version}/ diff --git a/ncomp-utils-java/.classpath b/ncomp-utils-java/.classpath index e0e6b3f..79ccca7 100644 --- a/ncomp-utils-java/.classpath +++ b/ncomp-utils-java/.classpath @@ -23,15 +23,5 @@ - - - - - - - - - - diff --git a/ncomp-utils-java/.settings/org.eclipse.core.resources.prefs b/ncomp-utils-java/.settings/org.eclipse.core.resources.prefs index 29abf99..e9441bb 100644 --- a/ncomp-utils-java/.settings/org.eclipse.core.resources.prefs +++ b/ncomp-utils-java/.settings/org.eclipse.core.resources.prefs @@ -1,6 +1,3 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 -encoding//src/test/java=UTF-8 -encoding//src/test/resources=UTF-8 encoding/=UTF-8 diff --git a/ncomp-utils-java/pom.xml b/ncomp-utils-java/pom.xml index 390c135..efc183e 100644 --- a/ncomp-utils-java/pom.xml +++ b/ncomp-utils-java/pom.xml @@ -1,20 +1,20 @@ - + + 4.0.0 org.openecomp.ncomp.utils ncomp-utils-java - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT UTF-8 1.7 1.7 - https://nexus.openecomp.org/content/repositories/releases/ - https://nexus.openecomp.org/content/repositories/snapshots/ - https://nexus.openecomp.org + https://nexus.onap.org/content/repositories/releases/ + https://nexus.onap.org/content/repositories/snapshots/ + https://nexus.onap.org ecomp-staging 176c31dfe190a - + https://nexus.onap.org @@ -48,8 +48,8 @@ maven-compiler-plugin 3.1 - - + + @@ -95,6 +95,11 @@ org.eclipse.emf.ecore.xmi 2.11.0-v20150123-0347 + + org.yaml + snakeyaml + 1.15 + @@ -110,8 +115,8 @@ ${openecomp.nexus.snapshots} - dcae-javadoc - ${site.urlroot}/${project.artifactId}/${project.version}/ + ecomp-site + dav:${nexusproxy}/content/sites/site/org/openecomp/ncomp/utils/${project.artifactId}/${project.version}/ diff --git a/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/FileUtils.java b/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/FileUtils.java index 423a1be..7c2e16d 100644 --- a/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/FileUtils.java +++ b/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/FileUtils.java @@ -635,7 +635,7 @@ public class FileUtils { public static String safeFileName(String file) { // creating file with safer creation. - if (file.contains("..")) + if (file.contains("../")) throw new RuntimeException("File name contain ..: " + file); if (file.contains("\n")) throw new RuntimeException("File name contain newline: " + file); diff --git a/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/JsonUtils.java b/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/JsonUtils.java index ee899ed..0fbb1d9 100644 --- a/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/JsonUtils.java +++ b/ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/JsonUtils.java @@ -22,6 +22,7 @@ package org.openecomp.ncomp.webservice.utils; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -29,6 +30,7 @@ import java.net.URL; import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Properties; import java.util.Vector; @@ -43,6 +45,7 @@ import org.json.JSONObject; import org.openecomp.ncomp.utils.PropertyUtil; import org.openecomp.ncomp.utils.StringUtil; +import org.yaml.snakeyaml.Yaml; public class JsonUtils { public static final Logger logger = Logger.getLogger(JsonUtils.class); @@ -464,4 +467,21 @@ public class JsonUtils { } return res; } + + public static JSONObject yaml2json(File file) throws IOException { + InputStream in = FileUtils.filename2stream(file.getAbsolutePath(), null); + if (in == null) + throw new RuntimeException("Unable to open: " + file); + ByteArrayOutputStream buf = new ByteArrayOutputStream(); + try { + FileUtils.copyStream(in, buf); + } finally { + in.close(); + buf.close(); + } + Yaml yaml= new Yaml(); + @SuppressWarnings("unchecked") + Map map= (Map) yaml.load(buf.toString()); + return new JSONObject(map); + } } diff --git a/ncomp-utils-journaling/pom.xml b/ncomp-utils-journaling/pom.xml index 8d86155..b0a64f3 100644 --- a/ncomp-utils-journaling/pom.xml +++ b/ncomp-utils-journaling/pom.xml @@ -1,20 +1,20 @@ - + + 4.0.0 org.openecomp.ncomp.utils ncomp-utils-journaling - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT UTF-8 1.7 1.7 - https://nexus.openecomp.org/content/repositories/releases/ - https://nexus.openecomp.org/content/repositories/snapshots/ - https://nexus.openecomp.org + https://nexus.onap.org/content/repositories/releases/ + https://nexus.onap.org/content/repositories/snapshots/ + https://nexus.onap.org ecomp-staging 176c31dfe190a - + https://nexus.onap.org @@ -48,8 +48,8 @@ maven-compiler-plugin 3.1 - - + + @@ -115,8 +115,8 @@ ${openecomp.nexus.snapshots} - dcae-javadoc - ${site.urlroot}/${project.artifactId}/${project.version}/ + ecomp-site + dav:${nexusproxy}/content/sites/site/org/openecomp/ncomp/utils/${project.artifactId}/${project.version}/ diff --git a/pom.xml b/pom.xml index 9cf54e4..ee8b6b1 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,5 @@ - + + 4.0.0 org.openecomp.ncomp.utils @@ -9,7 +9,7 @@ UTF-8 - + https://nexus.onap.org @@ -40,7 +40,7 @@ org.openecomp.ncomp.maven ncomp-maven-base - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT ../dcae-org.openecomp.ncomp.maven/ncomp-maven-base diff --git a/version.properties b/version.properties index c0f2742..13f6d31 100644 --- a/version.properties +++ b/version.properties @@ -2,7 +2,7 @@ # Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... ) # because they are used in Jenkins, whose plug-in doesn't support major=1 -minor=0 +minor=1 patch=0 base_version=${major}.${minor}.${patch} # Release must be completed with git revision # in Jenkins -- cgit 1.2.3-korg