1 19 20 package gui.updatecenterwizard.settings; 21 22 import java.io.File ; 23 import java.io.FileInputStream ; 24 import java.io.FileOutputStream ; 25 26 30 31 public class TestbagsProperties { 32 public static final String LOCAL_SERVER_TESTBAG_RESTARTED_PROPERTY_NAME = "LOCAL_SERVER_TESTBAG_RESTARTED"; 33 public static final String REMOTE_SERVER_TESTBAG_RESTARTED_PROPERTY_NAME = "REMOTE_SERVER_TESTBAG_RESTARTED"; 34 public static final String NB_SERVER_TESTBAG_RESTARTED_PROPERTY_NAME = "NB_SERVER_TESTBAG_RESTARTED"; 35 public static final String NBMS_USER_TESTBAG_RESTARTED_PROPERTY_NAME = "NBMS_USER_TESTBAG_RESTARTED"; 36 public static final String NBMS_GLOBAL_TESTBAG_RESTARTED_PROPERTY_NAME = "NBMS_GLOBAL_TESTBAG_RESTARTED"; 37 38 File testbagsFile = new File (System.getProperty("xtest.data") + File.separator + "settings" + File.separator + "_testbags.properties"); 39 40 41 public TestbagsProperties() { 42 } 43 44 public boolean readProperty(String propertyName){ 45 java.util.Properties p =new java.util.Properties (); 46 try{ 47 FileInputStream fis = new FileInputStream (testbagsFile); 48 p.load(fis); 49 fis.close(); 50 }catch(Exception e){ 51 e.printStackTrace(); 52 } 53 return Boolean.valueOf(p.getProperty(propertyName)).booleanValue(); 54 } 55 56 public void writeProperty(String propertyName, boolean value){ 57 java.util.Properties p =new java.util.Properties (); 58 try{ 59 FileInputStream fis = new FileInputStream (testbagsFile); 60 p.load(fis); 61 p.setProperty(propertyName, Boolean.toString(value)); 62 fis.close(); 63 64 FileOutputStream fos = new FileOutputStream (testbagsFile); 65 p.store(fos, null); 66 fos.close(); 67 68 }catch(Exception e){ 69 e.printStackTrace(); 70 } 71 } 72 73 74 75 } 76 | Popular Tags |