Loading src/main/java/ecorp/easy/installer/utils/ConfigParser.java +10 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package ecorp.easy.installer.utils; import ecorp.easy.installer.AppConstants; import ecorp.easy.installer.models.Command; import ecorp.easy.installer.models.RomSource; import ecorp.easy.installer.models.steps.BasicStep; import ecorp.easy.installer.models.steps.CustomExecutableStep; import ecorp.easy.installer.models.steps.CustomStep; Loading Loading @@ -232,24 +233,28 @@ public class ConfigParser { /** * Parse Sources To Download from Yaml file * @param yaml data load from Yaml * @return HashMap containing sources's URL & local path to store * @return HashMap<String, RomSource> containing sources's URL & local path to store associated to a key * @throws java.text.ParseException */ public static HashMap<String, String> parseSourcesToDownload(HashMap yaml) throws ParseException, ClassCastException{ public static HashMap<String, RomSource> parseSourcesToDownload(HashMap yaml) throws ParseException, ClassCastException{ logger.info("parseSourcesToDownload(...yaml...)"); HashMap<String, String> result = new HashMap<>(); HashMap<String, RomSource> result = new HashMap<>(); for(String key : (Set<String>) yaml.keySet() ){ Map source = (Map) yaml.get(key); //@TODO Would be better to put below tests elsewhere if(key.equals("rom")){ AppConstants.setEArchivePath((String) source.get("filePath")); } if(key.equals("twrp")){ AppConstants.setTwrpImgPath((String) source.get("filePath")); } logger.debug("--> url: {}, filePath: {}", source.get("url"), source.get("filePath")); result.put((String) source.get("url"), (String) source.get("filePath")); final RomSource currentSource = new RomSource((String) source.get("url"), (String) source.get("filePath")); result.put(key, currentSource ); } return result; } Loading Loading
src/main/java/ecorp/easy/installer/utils/ConfigParser.java +10 −5 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package ecorp.easy.installer.utils; import ecorp.easy.installer.AppConstants; import ecorp.easy.installer.models.Command; import ecorp.easy.installer.models.RomSource; import ecorp.easy.installer.models.steps.BasicStep; import ecorp.easy.installer.models.steps.CustomExecutableStep; import ecorp.easy.installer.models.steps.CustomStep; Loading Loading @@ -232,24 +233,28 @@ public class ConfigParser { /** * Parse Sources To Download from Yaml file * @param yaml data load from Yaml * @return HashMap containing sources's URL & local path to store * @return HashMap<String, RomSource> containing sources's URL & local path to store associated to a key * @throws java.text.ParseException */ public static HashMap<String, String> parseSourcesToDownload(HashMap yaml) throws ParseException, ClassCastException{ public static HashMap<String, RomSource> parseSourcesToDownload(HashMap yaml) throws ParseException, ClassCastException{ logger.info("parseSourcesToDownload(...yaml...)"); HashMap<String, String> result = new HashMap<>(); HashMap<String, RomSource> result = new HashMap<>(); for(String key : (Set<String>) yaml.keySet() ){ Map source = (Map) yaml.get(key); //@TODO Would be better to put below tests elsewhere if(key.equals("rom")){ AppConstants.setEArchivePath((String) source.get("filePath")); } if(key.equals("twrp")){ AppConstants.setTwrpImgPath((String) source.get("filePath")); } logger.debug("--> url: {}, filePath: {}", source.get("url"), source.get("filePath")); result.put((String) source.get("url"), (String) source.get("filePath")); final RomSource currentSource = new RomSource((String) source.get("url"), (String) source.get("filePath")); result.put(key, currentSource ); } return result; } Loading