Here you can find the source of close(URLConnection conn)
Parameter | Description |
---|---|
conn | the connection to close. |
public static void close(URLConnection conn)
//package com.java2s; //License from project: Open Source License import java.net.*; public class Main { /**/*from ww w. jav a 2s .c o m*/ * Closes a URLConnection. * * @param conn the connection to close. * @since 2.4 */ public static void close(URLConnection conn) { if (conn instanceof HttpURLConnection) { ((HttpURLConnection) conn).disconnect(); } } }