aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java
index d793a32b..cc3ec203 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java
@@ -198,6 +198,13 @@ public class PackageWrapper {
LOG.info("packageMeta = " + ToolUtil.objectToString(packageMeta));
PackageData packageData = PackageWrapperUtil.getPackageData(packageMeta);
+
+ List<PackageData> lstPkgData = PackageManager.getInstance().queryPackage(packageMeta.getName(), "", "", "", "");
+ if (!lstPkgData.isEmpty())
+ {
+ LOG.error ("Package name is not unique");
+ return null;
+ }
String destPath = File.separator + path + File.separator + File.separator;
boolean uploadResult = FileManagerFactory.createFileManager().upload(localDirName, destPath);