Close inputstream
This commit is contained in:
parent
d7817aef39
commit
e9c66f63fd
1 changed files with 12 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue