import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
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);
}
}
- public void initialize() throws FileNotFoundException, IOException {
+ private void initialize() throws IOException {
loadIfFileExists();
}
}
- public void loadIfFileExists() throws FileNotFoundException, IOException {
+ private void loadIfFileExists() throws IOException {
final File propertiesFile = getPropertiesFile();
if (propertiesFile.exists()) {
}
}
- 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();
}