Java HTTP Close closeQuietly(HttpURLConnection connection, Reader reader)

Here you can find the source of closeQuietly(HttpURLConnection connection, Reader reader)

Description

close Quietly

License

Apache License

Declaration

public static void closeQuietly(HttpURLConnection connection,
            Reader reader) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.*;
import java.net.HttpURLConnection;

public class Main {
    public static void closeQuietly(HttpURLConnection connection,
            Reader reader) {/*from w  ww . j a  v a 2  s.co m*/
        if (connection != null) {
            try {
                connection.disconnect();
            } catch (Exception ignored) {
            }
        }
        try {
            if (reader != null) {
                reader.close();
            }
        } catch (IOException ex) {
            // Ignore
        }
    }
}

Related

  1. close(URLConnection connection)
  2. closeAll(HttpURLConnection httpURLConnection, Writer writer, OutputStream outputStream)
  3. closeConnection(final HttpURLConnection connection)
  4. closeHttpUrlConnectionNoException(HttpURLConnection... closeables)
  5. closeQuietly(HttpURLConnection connection)
  6. closeQuietly(URLConnection cnn)
  7. closeSilently(HttpURLConnection resource)