return null;
}
- InputStream stream = TallyInputStream.getInputStream(connection);
- DecodedContent html = downloadHTMLStream(stream);
+ DecodedContent html;
+ try(InputStream is = TallyInputStream.getInputStream(connection)){
+ html = downloadHTMLStream(is);
+ }
- stream.close();
connection.disconnect();
HtmlSequence hseq = new HtmlSequence(url, datems, html);
byte[] authBytes = authData.getBytes(ENC_POST);
- OutputStream os = TallyOutputStream.getOutputStream(connection);
- os.write(authBytes);
- os.flush();
- os.close();
+ try(OutputStream os = TallyOutputStream.getOutputStream(connection)){
+ os.write(authBytes);
+ os.flush();
+ }
updateLastAccess(connection);
return null;
}
+ String urlTxt = absolute.toString();
BufferedImage image;
- image = getImageCache(absolute.toString());
+ image = getImageCache(urlTxt);
if(image != null) return image;
HttpURLConnection connection =
return null;
}
- InputStream stream = TallyInputStream.getInputStream(connection);
- image = ImageIO.read(stream);
- stream.close();
+ try(InputStream is = TallyInputStream.getInputStream(connection)){
+ image = ImageIO.read(is);
+ }
connection.disconnect();
- putImageCache(absolute.toString(), image);
+ putImageCache(urlTxt, image);
return image;
}