From 0a416f77d233733ae036cb3bd85f115a42371b8a Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Tue, 9 Jun 2015 09:37:17 +0200 Subject: [PATCH] Closedown --- plugins/TestingList.java | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/plugins/TestingList.java b/plugins/TestingList.java index c0b1e6e..a0824b4 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -338,17 +338,32 @@ public class TestingList extends Panel { public void loadTests() throws FileNotFoundException, IOException{ Properties prop = new Properties(); - String fileName = "../script/tests/devices/LS/.config"; - File file = new File(fileName); - InputStream fc = new FileInputStream(file); - this.jTextField1.setText(fc.toString()); - //prop.load(fc); - + FileInputStream fc = null; + try{ + String fileName = "../script/tests/devices/LS/.config"; + File file = new File(fileName); + fc = new FileInputStream(file); + this.jTextField1.setText(fc.toString()); + //prop.load(fc); - - //addToTable(prop.getProperty("name"), prop.getProperty("description")); - addToTable(("name"), ("description")); - //System.out.println(prop.getProperty("tests")); + + + //addToTable(prop.getProperty("name"), prop.getProperty("description")); + addToTable(("name"), ("description")); + //System.out.println(prop.getProperty("tests")); + } + catch (IOException e) { + this.jTextField1.setText(e.toString()); + e.printStackTrace(); + } + finally { + try { + if (fc != null) + fc.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } }