Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void print_content(HttpsURLConnection con) throws IOException {
- if (con != null) {
- System.out.println("****** Content of the URL ********");
- BufferedReader br = null;
- InputStreamReader inputStreamReader = null;
- try {
- inputStreamReader = new InputStreamReader(con.getInputStream());
- br = new BufferedReader(inputStreamReader);
- String input;
- while ((input = br.readLine()) != null) {
- System.out.println(input);
- }
- } finally {
- con.disconnect();
- if (null != inputStreamReader) {
- inputStreamReader.close();
- }
- if (null != br) {
- br.close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement