X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Finstantlauncher%2FConfiguration.java;h=94f9de2fdf4de1d46676e1b648be093aa97278fb;hb=8e31839bb326186944811ac3e54a3037ffa75106;hp=28f2f82af720d80f34fb7abb7a695df5c964d088;hpb=472d133468acb22e09f85b7e43e2143e59110275;p=instantlauncher.git diff --git a/src/main/java/eu/svjatoslav/instantlauncher/Configuration.java b/src/main/java/eu/svjatoslav/instantlauncher/Configuration.java index 28f2f82..94f9de2 100755 --- a/src/main/java/eu/svjatoslav/instantlauncher/Configuration.java +++ b/src/main/java/eu/svjatoslav/instantlauncher/Configuration.java @@ -2,7 +2,6 @@ package eu.svjatoslav.instantlauncher; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; @@ -11,15 +10,15 @@ public class Configuration { private static final String KEY_ROOT_DIRECTORY = "KEY_ROOT_DIRECTORY"; private static final String CONFIG_FILE_NAME = ".instantlauncher"; - Properties properties = new Properties(); + private final Properties properties = new Properties(); - boolean propertiesChanged = false; + private boolean propertiesChanged = false; - public Configuration() throws FileNotFoundException, IOException { + public Configuration() throws IOException { initialize(); } - public File getPropertiesFile() { + private File getPropertiesFile() { return new File(System.getProperty("user.home") + "/" + CONFIG_FILE_NAME); } @@ -35,7 +34,7 @@ public class Configuration { } - public void initialize() throws FileNotFoundException, IOException { + private void initialize() throws IOException { loadIfFileExists(); @@ -46,7 +45,7 @@ public class Configuration { } } - public void loadIfFileExists() throws FileNotFoundException, IOException { + private void loadIfFileExists() throws IOException { final File propertiesFile = getPropertiesFile(); if (propertiesFile.exists()) { @@ -56,11 +55,11 @@ public class Configuration { } } - public void saveFile() throws FileNotFoundException, IOException { + private void saveFile() throws IOException { properties.store(new FileOutputStream(getPropertiesFile()), "Instantlauncher configuration file."); } - public void validatePropertiesFile() { + private void validatePropertiesFile() { getRootDirectory(); }