aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Lund <lund@research.att.com>2017-03-11 13:00:55 +0000
committerCarsten Lund <lund@research.att.com>2017-04-16 13:24:09 +0000
commit03177c7c79176ab93d1be89762fc5841b33e4691 (patch)
tree6c7eb867b24c779a2b72b2bfe6d3366a922585d2
parent91712dc56c531cb4851eb473abc4b5fd986c58e5 (diff)
[DCAE-15] Changes related to version 1.1
See Jira for details Change-Id: I4e614cda9db201a72f831bdaa81ac2431fd43722 Signed-off-by: Carsten Lund <lund@research.att.com>
-rw-r--r--.gitreview2
-rw-r--r--ncomp-utils-java-extra/pom.xml22
-rw-r--r--ncomp-utils-java/.classpath10
-rw-r--r--ncomp-utils-java/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--ncomp-utils-java/pom.xml27
-rw-r--r--ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/FileUtils.java2
-rw-r--r--ncomp-utils-java/src/main/java/org/openecomp/ncomp/webservice/utils/JsonUtils.java20
-rw-r--r--ncomp-utils-journaling/pom.xml22
-rw-r--r--pom.xml8
-rw-r--r--version.properties2
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 @@
-<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">
+<?xml version="1.0"?>
+<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openecomp.ncomp.utils</groupId>
<artifactId>ncomp-utils-java-extra</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
- <openecomp.nexus.releases>https://nexus.openecomp.org/content/repositories/releases/</openecomp.nexus.releases>
- <openecomp.nexus.snapshots>https://nexus.openecomp.org/content/repositories/snapshots/</openecomp.nexus.snapshots>
- <openecomp.nexus.proxy>https://nexus.openecomp.org</openecomp.nexus.proxy>
+ <openecomp.nexus.releases>https://nexus.onap.org/content/repositories/releases/</openecomp.nexus.releases>
+ <openecomp.nexus.snapshots>https://nexus.onap.org/content/repositories/snapshots/</openecomp.nexus.snapshots>
+ <openecomp.nexus.proxy>https://nexus.onap.org</openecomp.nexus.proxy>
<openecomp.nexus.staging.serverId>ecomp-staging</openecomp.nexus.staging.serverId>
<openecomp.nexus.staging.profileId>176c31dfe190a</openecomp.nexus.staging.profileId>
- </properties>
+ <nexusproxy>https://nexus.onap.org</nexusproxy></properties>
<build>
@@ -48,8 +48,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
- <source />
- <target />
+ <source/>
+ <target/>
</configuration>
</plugin>
</plugins>
@@ -115,8 +115,8 @@
<url>${openecomp.nexus.snapshots}</url>
</snapshotRepository>
<site>
- <id>dcae-javadoc</id>
- <url>${site.urlroot}/${project.artifactId}/${project.version}/</url>
+ <id>ecomp-site</id>
+ <url>dav:${nexusproxy}/content/sites/site/org/openecomp/ncomp/utils/${project.artifactId}/${project.version}/</url>
</site>
</distributionManagement>
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 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
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/<project>=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 @@
-<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">
+<?xml version="1.0"?>
+<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openecomp.ncomp.utils</groupId>
<artifactId>ncomp-utils-java</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
- <openecomp.nexus.releases>https://nexus.openecomp.org/content/repositories/releases/</openecomp.nexus.releases>
- <openecomp.nexus.snapshots>https://nexus.openecomp.org/content/repositories/snapshots/</openecomp.nexus.snapshots>
- <openecomp.nexus.proxy>https://nexus.openecomp.org</openecomp.nexus.proxy>
+ <openecomp.nexus.releases>https://nexus.onap.org/content/repositories/releases/</openecomp.nexus.releases>
+ <openecomp.nexus.snapshots>https://nexus.onap.org/content/repositories/snapshots/</openecomp.nexus.snapshots>
+ <openecomp.nexus.proxy>https://nexus.onap.org</openecomp.nexus.proxy>
<openecomp.nexus.staging.serverId>ecomp-staging</openecomp.nexus.staging.serverId>
<openecomp.nexus.staging.profileId>176c31dfe190a</openecomp.nexus.staging.profileId>
- </properties>
+ <nexusproxy>https://nexus.onap.org</nexusproxy></properties>
<build>
@@ -48,8 +48,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
- <source />
- <target />
+ <source/>
+ <target/>
</configuration>
</plugin>
</plugins>
@@ -95,6 +95,11 @@
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.11.0-v20150123-0347</version>
</dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.15</version>
+ </dependency>
</dependencies>
@@ -110,8 +115,8 @@
<url>${openecomp.nexus.snapshots}</url>
</snapshotRepository>
<site>
- <id>dcae-javadoc</id>
- <url>${site.urlroot}/${project.artifactId}/${project.version}/</url>
+ <id>ecomp-site</id>
+ <url>dav:${nexusproxy}/content/sites/site/org/openecomp/ncomp/utils/${project.artifactId}/${project.version}/</url>
</site>
</distributionManagement>
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<String,Object> map= (Map<String, Object>) 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 @@
-<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">
+<?xml version="1.0"?>
+<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openecomp.ncomp.utils</groupId>
<artifactId>ncomp-utils-journaling</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
- <openecomp.nexus.releases>https://nexus.openecomp.org/content/repositories/releases/</openecomp.nexus.releases>
- <openecomp.nexus.snapshots>https://nexus.openecomp.org/content/repositories/snapshots/</openecomp.nexus.snapshots>
- <openecomp.nexus.proxy>https://nexus.openecomp.org</openecomp.nexus.proxy>
+ <openecomp.nexus.releases>https://nexus.onap.org/content/repositories/releases/</openecomp.nexus.releases>
+ <openecomp.nexus.snapshots>https://nexus.onap.org/content/repositories/snapshots/</openecomp.nexus.snapshots>
+ <openecomp.nexus.proxy>https://nexus.onap.org</openecomp.nexus.proxy>
<openecomp.nexus.staging.serverId>ecomp-staging</openecomp.nexus.staging.serverId>
<openecomp.nexus.staging.profileId>176c31dfe190a</openecomp.nexus.staging.profileId>
- </properties>
+ <nexusproxy>https://nexus.onap.org</nexusproxy></properties>
<build>
@@ -48,8 +48,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
- <source />
- <target />
+ <source/>
+ <target/>
</configuration>
</plugin>
</plugins>
@@ -115,8 +115,8 @@
<url>${openecomp.nexus.snapshots}</url>
</snapshotRepository>
<site>
- <id>dcae-javadoc</id>
- <url>${site.urlroot}/${project.artifactId}/${project.version}/</url>
+ <id>ecomp-site</id>
+ <url>dav:${nexusproxy}/content/sites/site/org/openecomp/ncomp/utils/${project.artifactId}/${project.version}/</url>
</site>
</distributionManagement>
diff --git a/pom.xml b/pom.xml
index 9cf54e4..ee8b6b1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,5 @@
-<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">
+<?xml version="1.0"?>
+<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openecomp.ncomp.utils</groupId>
@@ -9,7 +9,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
+ <nexusproxy>https://nexus.onap.org</nexusproxy></properties>
@@ -40,7 +40,7 @@
<parent>
<groupId>org.openecomp.ncomp.maven</groupId>
<artifactId>ncomp-maven-base</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<relativePath>../dcae-org.openecomp.ncomp.maven/ncomp-maven-base</relativePath>
</parent>
</project>
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