Here you can find the source of getLastModified(URL url)
Parameter | Description |
---|---|
url | The URL to get the timestamp for |
public static long getLastModified(URL url)
//package com.java2s; //License from project: Apache License import java.net.URL; import java.net.URLConnection; public class Main { /**/*from w w w. j ava 2 s.c om*/ * Returns the last modified time stamp for the passed URL * @param url The URL to get the timestamp for * @return the last modified time stamp for the passed URL */ public static long getLastModified(URL url) { URLConnection conn = null; try { conn = nvl(url, "Passed URL was null").openConnection(); return conn.getLastModified(); } catch (Exception e) { throw new RuntimeException("Failed to get LastModified for [" + url + "]", e); } } public static <T> T nvl(T t, String message) { if (t == null) throw new IllegalArgumentException(message); return (T) t; } }