From 6caea5cc6d3d36235c5fcab401871d203d7f6595 Mon Sep 17 00:00:00 2001
From: marvin <marvin@marvin-TERRA-MOBILE-1529H>
Date: Thu, 19 Mar 2020 12:10:03 +0100
Subject: [PATCH] ...

---
 .../features/ConfiguratorMain/Adapter.java           | 12 ++++++------
 .../features/ConfiguratorMain/XMLHelper.java         |  5 +++--
 src/var/FeatureModelConfigurator/src/Adapter.java    | 12 ++++++------
 src/var/FeatureModelConfigurator/src/XMLHelper.java  |  5 +++--
 src/var/FeatureModelImplGenerator/src/Adapter.java   | 12 ++++++------
 src/var/FeatureModelImplGenerator/src/XMLHelper.java |  5 +++--
 6 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Adapter.java b/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Adapter.java
index c535d1a..f10e1a1 100644
--- a/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Adapter.java
+++ b/src/var/FeatureModelConfigurator/features/ConfiguratorMain/Adapter.java
@@ -91,12 +91,12 @@ public class Adapter extends XMLHelper {
 				case "Custom":
 					List<Attribute> sensorList = xQueryAttributes(featureModel, "//sensor/@name");
 					
-					List<String> scAutoList = getFileNames(scAutoPath);
-					List<String> scOtherList = getFileNames(scOtherPath);
-					List<String> scList = new ArrayList<String>();
-					scList.addAll(scAutoList);
-					scList.addAll(scOtherList);
-					
+//					List<String> scAutoList = getFileNames(scAutoPath);
+//					List<String> scOtherList = getFileNames(scOtherPath);
+//					List<String> scList = new ArrayList<String>();
+//					scList.addAll(scAutoList);
+//					scList.addAll(scOtherList);
+//					
 //					for(Attribute sensor : sensorList) {
 //						boolean inDirectory = false;
 //						for(String fileName : scList) {
diff --git a/src/var/FeatureModelConfigurator/features/ConfiguratorMain/XMLHelper.java b/src/var/FeatureModelConfigurator/features/ConfiguratorMain/XMLHelper.java
index 588c9b0..08c3067 100644
--- a/src/var/FeatureModelConfigurator/features/ConfiguratorMain/XMLHelper.java
+++ b/src/var/FeatureModelConfigurator/features/ConfiguratorMain/XMLHelper.java
@@ -84,7 +84,8 @@ public class XMLHelper {
 	}
 	
 	/**
-	 * Check whether the given directory exists and if not, create it.
+	 * Check whether the given directory exists and if not, create it including all possibly
+	 * nonexisting parent directories.
 	 * 
 	 * @param path		Path to directory as String
 	 * @return false if directory denoted by path does not exist and could not be created; true otherwise
@@ -92,7 +93,7 @@ public class XMLHelper {
 	public static boolean checkDirectory(String path) {
 		File directory = new File(path);
 		if(!directory.exists()) {
-			boolean created = directory.mkdir();
+			boolean created = directory.mkdirs();
 			if(!created) {
 				System.err.println("Error: Directory \'"+directory.getPath()+"\' does not exist and could not be created.");
 				return false;
diff --git a/src/var/FeatureModelConfigurator/src/Adapter.java b/src/var/FeatureModelConfigurator/src/Adapter.java
index c535d1a..f10e1a1 100644
--- a/src/var/FeatureModelConfigurator/src/Adapter.java
+++ b/src/var/FeatureModelConfigurator/src/Adapter.java
@@ -91,12 +91,12 @@ public class Adapter extends XMLHelper {
 				case "Custom":
 					List<Attribute> sensorList = xQueryAttributes(featureModel, "//sensor/@name");
 					
-					List<String> scAutoList = getFileNames(scAutoPath);
-					List<String> scOtherList = getFileNames(scOtherPath);
-					List<String> scList = new ArrayList<String>();
-					scList.addAll(scAutoList);
-					scList.addAll(scOtherList);
-					
+//					List<String> scAutoList = getFileNames(scAutoPath);
+//					List<String> scOtherList = getFileNames(scOtherPath);
+//					List<String> scList = new ArrayList<String>();
+//					scList.addAll(scAutoList);
+//					scList.addAll(scOtherList);
+//					
 //					for(Attribute sensor : sensorList) {
 //						boolean inDirectory = false;
 //						for(String fileName : scList) {
diff --git a/src/var/FeatureModelConfigurator/src/XMLHelper.java b/src/var/FeatureModelConfigurator/src/XMLHelper.java
index 588c9b0..08c3067 100644
--- a/src/var/FeatureModelConfigurator/src/XMLHelper.java
+++ b/src/var/FeatureModelConfigurator/src/XMLHelper.java
@@ -84,7 +84,8 @@ public class XMLHelper {
 	}
 	
 	/**
-	 * Check whether the given directory exists and if not, create it.
+	 * Check whether the given directory exists and if not, create it including all possibly
+	 * nonexisting parent directories.
 	 * 
 	 * @param path		Path to directory as String
 	 * @return false if directory denoted by path does not exist and could not be created; true otherwise
@@ -92,7 +93,7 @@ public class XMLHelper {
 	public static boolean checkDirectory(String path) {
 		File directory = new File(path);
 		if(!directory.exists()) {
-			boolean created = directory.mkdir();
+			boolean created = directory.mkdirs();
 			if(!created) {
 				System.err.println("Error: Directory \'"+directory.getPath()+"\' does not exist and could not be created.");
 				return false;
diff --git a/src/var/FeatureModelImplGenerator/src/Adapter.java b/src/var/FeatureModelImplGenerator/src/Adapter.java
index c535d1a..f10e1a1 100644
--- a/src/var/FeatureModelImplGenerator/src/Adapter.java
+++ b/src/var/FeatureModelImplGenerator/src/Adapter.java
@@ -91,12 +91,12 @@ public class Adapter extends XMLHelper {
 				case "Custom":
 					List<Attribute> sensorList = xQueryAttributes(featureModel, "//sensor/@name");
 					
-					List<String> scAutoList = getFileNames(scAutoPath);
-					List<String> scOtherList = getFileNames(scOtherPath);
-					List<String> scList = new ArrayList<String>();
-					scList.addAll(scAutoList);
-					scList.addAll(scOtherList);
-					
+//					List<String> scAutoList = getFileNames(scAutoPath);
+//					List<String> scOtherList = getFileNames(scOtherPath);
+//					List<String> scList = new ArrayList<String>();
+//					scList.addAll(scAutoList);
+//					scList.addAll(scOtherList);
+//					
 //					for(Attribute sensor : sensorList) {
 //						boolean inDirectory = false;
 //						for(String fileName : scList) {
diff --git a/src/var/FeatureModelImplGenerator/src/XMLHelper.java b/src/var/FeatureModelImplGenerator/src/XMLHelper.java
index 588c9b0..08c3067 100644
--- a/src/var/FeatureModelImplGenerator/src/XMLHelper.java
+++ b/src/var/FeatureModelImplGenerator/src/XMLHelper.java
@@ -84,7 +84,8 @@ public class XMLHelper {
 	}
 	
 	/**
-	 * Check whether the given directory exists and if not, create it.
+	 * Check whether the given directory exists and if not, create it including all possibly
+	 * nonexisting parent directories.
 	 * 
 	 * @param path		Path to directory as String
 	 * @return false if directory denoted by path does not exist and could not be created; true otherwise
@@ -92,7 +93,7 @@ public class XMLHelper {
 	public static boolean checkDirectory(String path) {
 		File directory = new File(path);
 		if(!directory.exists()) {
-			boolean created = directory.mkdir();
+			boolean created = directory.mkdirs();
 			if(!created) {
 				System.err.println("Error: Directory \'"+directory.getPath()+"\' does not exist and could not be created.");
 				return false;
-- 
GitLab