public static void saveEditorProperties() { FileOutputStream out = null; try { out = new FileOutputStream(FileUtil.getEditorConfigFile()); getEditorProperties().store(out, "Robocode Editor Properties"); } catch (IOException e) { Logger.logError(e); } finally { if (out != null) { try { out.close(); } catch (IOException ignored) {} } } } }
public static EditorProperties getEditorProperties() { if (editorProperties == null) { editorProperties = new EditorProperties(); FileInputStream in = null; File file = null; try { in = new FileInputStream(FileUtil.getEditorConfigFile()); getEditorProperties().load(in); } catch (FileNotFoundException e) { logMessage("Editor properties file was not found. A new one will be created."); } catch (IOException e) { logError("Error while reading file: " + file, e); } finally { if (in != null) { try { in.close(); } catch (IOException ignored) {} } } } return editorProperties; }