mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Close stream in FileUtils.addLines()
This commit is contained in:
parent
5517d03fae
commit
6fb95d6226
1 changed files with 8 additions and 3 deletions
|
@ -90,10 +90,15 @@ public final class FileUtils {
|
||||||
InputStream is = getStreamForUri(uri, null);
|
InputStream is = getStreamForUri(uri, null);
|
||||||
InputStreamReader sr = new InputStreamReader(is, StringUtils.UTF8);
|
InputStreamReader sr = new InputStreamReader(is, StringUtils.UTF8);
|
||||||
BufferedReader br = new BufferedReader(sr);
|
BufferedReader br = new BufferedReader(sr);
|
||||||
|
try {
|
||||||
String line;
|
String line;
|
||||||
while ((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
set.add(line);
|
set.add(line);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
br.close();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue