From 28b3fccdf57c658a4255ca7d086f866af77674b1 Mon Sep 17 00:00:00 2001 From: mguessan Date: Sat, 20 Oct 2007 18:33:31 +0000 Subject: [PATCH] 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 --- src/java/davmail/Settings.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/java/davmail/Settings.java b/src/java/davmail/Settings.java index a967a4b3..650a06e1 100644 --- a/src/java/davmail/Settings.java +++ b/src/java/davmail/Settings.java @@ -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); }