Java HTTP Close closeConnection(final HttpURLConnection connection)

Here you can find the source of closeConnection(final HttpURLConnection connection)

Description

close Connection

License

Apache License

Declaration

public static void closeConnection(final HttpURLConnection connection) 

Method Source Code

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

import java.net.HttpURLConnection;

public class Main {
    public static void closeConnection(final HttpURLConnection connection) {
        if (connection != null) {
            connection.disconnect();//from  w ww .  j  a v a2s  .co  m
        }
    }
}

Related

  1. close(final URLConnection conn)
  2. close(java.net.HttpURLConnection hconn)
  3. close(URLConnection conn)
  4. close(URLConnection connection)
  5. closeAll(HttpURLConnection httpURLConnection, Writer writer, OutputStream outputStream)
  6. closeHttpUrlConnectionNoException(HttpURLConnection... closeables)
  7. closeQuietly(HttpURLConnection connection)
  8. closeQuietly(HttpURLConnection connection, Reader reader)
  9. closeQuietly(URLConnection cnn)