Java URL Connection getHeaderFieldLong(URLConnection conn, String name, long Default)

Here you can find the source of getHeaderFieldLong(URLConnection conn, String name, long Default)

Description

Java 7 method

License

Creative Commons License

Parameter

Parameter Description
name a parameter
Default a parameter

Declaration

public static long getHeaderFieldLong(URLConnection conn, String name, long Default) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

import java.net.URLConnection;

public class Main {
    /**//from  ww  w . j  ava 2  s. c om
     * Java 7 method
     * 
     * @param name
     * @param Default
     * @return
     */
    public static long getHeaderFieldLong(URLConnection conn, String name, long Default) {
        String value = conn.getHeaderField(name);
        try {
            return Long.parseLong(value);
        } catch (Exception e) {
        }
        return Default;
    }
}

Related

  1. getDefaultUrlConnection(URL url)
  2. getFeedReader(URL feedUrl)
  3. getFromUrl(String url)
  4. getGlobalAddress(String url)
  5. getGlobalIPAddress(URL automationPage)
  6. getHTML(String url, boolean removeNonLatinChars)
  7. getHTML(URL url)
  8. getHttpGetContent(String strUrl, String charSet)
  9. getHttpHeaders(URLConnection connection)