URLConnection: getLastModified() : URLConnection « java.net « Java by API






URLConnection: getLastModified()

  

import java.net.URL;
import java.net.URLConnection;

public class Main {
  public static void main(String[] argv) throws Exception {
    URL u = new URL("http://127.0.0.1/test.gif");
    URLConnection uc = u.openConnection();
    uc.setUseCaches(false);
    long timestamp = uc.getLastModified();

  }
}

   
    
  








Related examples in the same category

1.URLConnection: connect() throws IOException
2.URLConnection: getContentEncoding()
3.URLConnection: getContentType()
4.URLConnection: getExpiration()
5.URLConnection: getHeaderFields()
6.URLConnection: getHeaderField(int n)
7.URLConnection: getHeaderFieldKey(int n)
8.URLConnection: getInputStream()
9.URLConnection: getIfModifiedSince()
10.URLConnection: getURL()
11.URLConnection: setAllowUserInteraction(boolean allowuserinteraction)
12.URLConnection: setDoInput(boolean doinput)
13.URLConnection: setDoOutput(boolean dooutput)
14.URLConnection: setIfModifiedSince(long ifmodifiedsince)
15.URLConnection: setRequestProperty(String key, String value)
16.URLConnection: setUseCaches(boolean usecaches)