Java tutorial
//package com.java2s; import java.net.HttpURLConnection; public class Main { public static void disconnectSafely(HttpURLConnection connect) { if (connect != null) { try { connect.disconnect(); } catch (Exception e) { e.printStackTrace(); } } } }