forked from I2P_Developers/i2p.i2p
Close resources
This commit is contained in:
@ -214,12 +214,12 @@ public class SAMBridge implements Runnable, ClientApp {
|
||||
private void loadKeys() {
|
||||
synchronized (nameToPrivKeys) {
|
||||
nameToPrivKeys.clear();
|
||||
FileInputStream in = null;
|
||||
BufferedReader br = null;
|
||||
try {
|
||||
in = new FileInputStream(persistFilename);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
||||
br = new BufferedReader(new InputStreamReader(
|
||||
new FileInputStream(persistFilename)));
|
||||
String line = null;
|
||||
while ( (line = reader.readLine()) != null) {
|
||||
while ( (line = br.readLine()) != null) {
|
||||
int eq = line.indexOf('=');
|
||||
String name = line.substring(0, eq);
|
||||
String privKeys = line.substring(eq+1);
|
||||
@ -230,7 +230,7 @@ public class SAMBridge implements Runnable, ClientApp {
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Unable to read the keys from " + persistFilename, ioe);
|
||||
} finally {
|
||||
if (in != null) try { in.close(); } catch (IOException ioe) {}
|
||||
if (br != null) try { br.close(); } catch (IOException ioe) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user