Java HTTP Close close(final URLConnection conn)

Here you can find the source of close(final URLConnection conn)

Description

close

License

Apache License

Declaration

public static void close(final URLConnection conn) 

Method Source Code

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

import java.net.HttpURLConnection;

import java.net.URLConnection;

public class Main {
    public static void close(final URLConnection conn) {
        if (conn instanceof HttpURLConnection) {
            ((HttpURLConnection) conn).disconnect();
        }/*from  w  ww. j  ava  2 s  .c  o  m*/
    }
}

Related

  1. close(java.net.HttpURLConnection hconn)
  2. close(URLConnection conn)
  3. close(URLConnection connection)
  4. closeAll(HttpURLConnection httpURLConnection, Writer writer, OutputStream outputStream)