public File getCommentFile(VideoInfo vi, String fileName, EnumSet<DownloadCommentType> types,
WayBackInfo wayback, int commentNum) throws Exception {
HttpResponse response = null;
+ BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try {
post.setEntity(se);
response = http.execute(post);
final InputStream is = response.getEntity().getContent();
- final BufferedInputStream bis = new BufferedInputStream(is);
+ bis = new BufferedInputStream(is);
final String outputFileName = (fileName.endsWith(".xml")) ? fileName : fileName + ".xml";
bos = new BufferedOutputStream(new FileOutputStream(outputFileName));
if (response != null) {
EntityUtils.consume(response.getEntity());
}
+ if (bis != null) {
+ bis.close();
+ }
if (bos != null) {
bos.close();
}