mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-12 18:52:21 -05:00
replace FileReader with FileInputStream (constructor not available before 1.6)
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@83 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
0f4a12b3c4
commit
28b3fccdf5
@ -3,10 +3,7 @@ package davmail;
|
||||
import davmail.tray.DavGatewayTray;
|
||||
|
||||
import java.util.Properties;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Settings facade
|
||||
@ -28,7 +25,7 @@ public class Settings {
|
||||
}
|
||||
|
||||
public static synchronized void load() {
|
||||
FileReader fileReader = null;
|
||||
FileInputStream fileInputStream = null;
|
||||
try {
|
||||
if (configFilePath == null) {
|
||||
//noinspection AccessOfSystemProperties
|
||||
@ -36,8 +33,8 @@ public class Settings {
|
||||
}
|
||||
File configFile = new File(configFilePath);
|
||||
if (configFile.exists()) {
|
||||
fileReader = new FileReader(configFile);
|
||||
SETTINGS.load(fileReader);
|
||||
fileInputStream = new FileInputStream(configFile);
|
||||
SETTINGS.load(fileInputStream);
|
||||
} else {
|
||||
isFirstStart = true;
|
||||
|
||||
@ -57,9 +54,9 @@ public class Settings {
|
||||
} catch (IOException e) {
|
||||
DavGatewayTray.error("Unable to load settings: ", e);
|
||||
} finally {
|
||||
if (fileReader != null) {
|
||||
if (fileInputStream != null) {
|
||||
try {
|
||||
fileReader.close();
|
||||
fileInputStream.close();
|
||||
} catch (IOException e) {
|
||||
DavGatewayTray.debug("Error closing configuration file: ", e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user