From bdbc1e702a3828c37d57c1f7d54fe0034d882653 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Fri, 9 Oct 2015 15:45:53 +0200 Subject: [PATCH] Closedown --- plugins/TestingList.java | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 6cc57af..7ef2ee4 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -286,6 +286,7 @@ public class TestingList extends Panel { public static Path TESTS_DEVICES_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "devices"); public static Path TESTS_TESTS_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "tests"); public static Path TESTS_CONFIG_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "config"); + public static Path TESTS_PROPERTIES_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "tests.properties"); public final Path TESTS_LOG_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "log", "TestsLog" + getnow() + ".txt"); public static String TESTS_CONFIG_FILENAME = ".config"; public static String TESTS_HELP_FILENAME = "help.html"; @@ -299,6 +300,7 @@ public class TestingList extends Panel { initLogger(); buildTable(); closeCustomPanel(); + loadProperties(); try { loadTests(); //if not administrator, then show only enabled tests @@ -315,6 +317,27 @@ public class TestingList extends Panel { } + private void loadProperties(){ + File configFile = TESTS_PROPERTIES_DEFAULT_DIR.toFile(); + if (!configFile.isFile()) return; + + try { + FileReader reader = new FileReader(configFile); + Properties props = new Properties(); + props.load(reader); + + String customPanel = props.getProperty("customPanel"); + + System.out.print("Custom Panel: " + customPanel); + reader.close(); + } catch (FileNotFoundException ex) { + // file does not exist + } catch (IOException ex) { + // I/O error + } + } + + /** * close the custom panel if present */ @@ -333,7 +356,7 @@ public class TestingList extends Panel { Path pluginsPath = Paths.get(".", "home", "config", "plugins.properties"); List stringBuffer =new ArrayList() ; try { - File file = new File(pluginsPath.toString()); + File file = pluginsPath.toFile(); FileReader fileReader = new FileReader(file); BufferedReader bufferedReader = new BufferedReader(fileReader); String line, fileName;