summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/ToscaTreeManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/ToscaTreeManager.java')
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/ToscaTreeManager.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/ToscaTreeManager.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/ToscaTreeManager.java
index 944ab62f9f..6957cb4fd6 100644
--- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/ToscaTreeManager.java
+++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/ToscaTreeManager.java
@@ -12,8 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-**/
-
+ **/
package org.openecomp.sdc.heat.services.tree;
import java.io.File;
@@ -22,7 +21,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Pattern;
-
import org.openecomp.core.utilities.file.FileContentHandler;
import org.openecomp.sdc.common.utils.SdcCommon;
import org.openecomp.sdc.datatypes.error.ErrorMessage;
@@ -37,7 +35,6 @@ public class ToscaTreeManager {
private HeatStructureTree tree = new HeatStructureTree();
private Map<String, HeatStructureTree> fileTreeRef = new HashMap<>();
-
/**
* Add file.
*
@@ -60,14 +57,12 @@ public class ToscaTreeManager {
}
}
- private void addFileToTree(String[] splitFilename, int startIndex, String fullFileName,
- HeatStructureTree parent) {
+ private void addFileToTree(String[] splitFilename, int startIndex, String fullFileName, HeatStructureTree parent) {
fileTreeRef.putIfAbsent(fullFileName, new HeatStructureTree());
HeatStructureTree heatStructureTree = fileTreeRef.get(fullFileName);
heatStructureTree.setFileName(splitFilename[startIndex]);
if (startIndex < splitFilename.length - 1) {
- addFileToTree(splitFilename, startIndex + 1,
- getFullFileName(fullFileName, splitFilename[startIndex + 1]), heatStructureTree);
+ addFileToTree(splitFilename, startIndex + 1, getFullFileName(fullFileName, splitFilename[startIndex + 1]), heatStructureTree);
}
parent.addHeatStructureTreeToNestedHeatList(heatStructureTree);
}
@@ -78,9 +73,8 @@ public class ToscaTreeManager {
* @param validationErrors the validation errors
*/
public void addErrors(Map<String, List<ErrorMessage>> validationErrors) {
- validationErrors.entrySet().stream().filter(entry ->
- Objects.nonNull(fileTreeRef.get(entry.getKey()))).forEach(entry -> entry.getValue()
- .forEach(error -> fileTreeRef.get(entry.getKey()).addErrorToErrorsList(error)));
+ validationErrors.entrySet().stream().filter(entry -> Objects.nonNull(fileTreeRef.get(entry.getKey())))
+ .forEach(entry -> entry.getValue().forEach(error -> fileTreeRef.get(entry.getKey()).addErrorToErrorsList(error)));
}
private String getFullFileName(String parentFullName, String fileName) {
@@ -91,7 +85,6 @@ public class ToscaTreeManager {
if (filename.contains("/")) {
return filename.split("/");
}
-
return filename.split(Pattern.quote(File.separator));
}