if (srcConn != null) { if (srcConn instanceof HttpURLConnection) {  ((HttpURLConnection) srcConn).disconnect(); } }
disconnect(srcConn);
    public void download(URL src, File dest, CopyProgressListener l) throws IOException {        URLConnection srcConn = null;        try {            srcConn = src.openConnection();            int contentLength = srcConn.getContentLength();            FileUtil.copy(srcConn.getInputStream(), dest, l);            if (dest.length() != contentLength && contentLength != -1) {            	dest.delete();            	throw new IOException("Downloaded file size doesn't match expected Content Length for "+src+". Please retry.");            }        }        finally {            if (srcConn != null) {                if (srcConn instanceof HttpURLConnection) {                    //System.out.println("Closing HttpURLConnection");                    ((HttpURLConnection) srcConn).disconnect();                }            }        }    }