[SDC-29] rebase continue work to align source
[sdc.git] / ui-ci-dev / src / main / java / org / openecomp / sdc / uici / tests / utilities / FileHandling.java
1 package org.openecomp.sdc.uici.tests.utilities;
2
3 import java.io.File;
4 import java.io.FileInputStream;
5 import java.io.FileNotFoundException;
6 import java.io.InputStream;
7 import java.util.Map;
8
9 import org.yaml.snakeyaml.Yaml;
10
11 public class FileHandling {
12
13         public static Map<?, ?> parseYamlFile(String filePath) throws FileNotFoundException {
14                 Yaml yaml = new Yaml();
15                 File file = new File(filePath);
16                 InputStream inputStream = new FileInputStream(file);
17                 Map<?, ?> map = (Map<?, ?>) yaml.load(inputStream);
18                 return map;
19         }
20
21         public static String getBasePath() {
22                 return System.getProperty("user.dir");
23         }
24
25         public static String getResourcesFilesPath() {
26                 return getBasePath() + File.separator + "src" + File.separator + "main" + File.separator + "resources"
27                                 + File.separator + "Files" + File.separator;
28         }
29
30 }