public static PropertyValueType getValueType(String key) { SettingProperty sp = SettingPropertyManager.getInstance().getPropertyInstance(key); if (sp.getValue().equalsIgnoreCase("true") || sp.getValue().equalsIgnoreCase("false")) { return Boolean; } try { Integer.parseInt(sp.getValue()); return Int; } catch (Exception e) { return String; } }
public void saveProperties() { System.out.println("Saving Props"); try { BufferedWriter bw = new BufferedWriter(new FileWriter(propFile)); for (SettingCatagory cat : catagories.values()) { bw.write("C:" + cat.getKey() + ":" + cat.getDescription() + "\n"); for (String key : cat.getProperties()) { SettingProperty sp = properties.get(key); bw.write(" P:" + key + ":" + sp.getDescription() + ":" + sp.getValue() + "\n"); } } bw.close(); } catch (Exception e) { e.printStackTrace(); } }