Java URL Connection setTimeout(URLConnection conn, int milliseconds)

Here you can find the source of setTimeout(URLConnection conn, int milliseconds)

Description

set Timeout

License

Open Source License

Declaration

private static void setTimeout(URLConnection conn, int milliseconds) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010, 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * /*from w  ww  .  j a va2s  .c  o m*/
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.net.URLConnection;

public class Main {
    private static void setTimeout(URLConnection conn, int milliseconds) {
        conn.setConnectTimeout(milliseconds);
    }
}

Related

  1. retrieveHtml(URLConnection http)
  2. scanPackageByJar(List> classes, final String packageName, final URL jarUrl, final boolean recursive)
  3. sendGetRequest(String resourceUrl, String contentType)
  4. sendGetRequest(String urlStr)
  5. sendPost(String url, String param)
  6. setTimeouts(URLConnection connection)
  7. shortenUrl(String url)
  8. skip(URLConnection connection, long count)
  9. slurpStream(URLConnection conn)