Close inputstream

This commit is contained in:
LexManos 2012-06-21 06:11:17 -07:00
parent d7817aef39
commit e9c66f63fd

View file

@ -169,6 +169,7 @@ public class Configuration
public void load() public void load()
{ {
BufferedReader buffer = null;
try try
{ {
if (file.getParentFile() != null) if (file.getParentFile() != null)
@ -184,7 +185,7 @@ public class Configuration
if (file.canRead()) if (file.canRead())
{ {
FileInputStream fileinputstream = new FileInputStream(file); FileInputStream fileinputstream = new FileInputStream(file);
BufferedReader buffer = new BufferedReader(new InputStreamReader(fileinputstream, "8859_1")); buffer = new BufferedReader(new InputStreamReader(fileinputstream, "8859_1"));
String line; String line;
Map<String, Property> currentMap = null; Map<String, Property> currentMap = null;
@ -265,6 +266,16 @@ public class Configuration
{ {
e.printStackTrace(); e.printStackTrace();
} }
finally
{
if (buffer != null)
{
try
{
buffer.close();
} catch (IOException e){}
}
}
} }
public void save() public void save()