Trouver quand le document web a été modifié

Author:

 url, date, url, java
{filelink=9051}


import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Date;

public class DateModif
{

  public static void main(String args[]) throws Exception
  	{
    URL url = new URL("http://www.exemple.com");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();

    long date = conn.getDate();
    if (date > 0)
      System.out.println(new Date(date));

 }
}

A Voir sur le même Sujet:

  • réseau en java api java.net

Leave a Reply

Your email address will not be published. Required fields are marked *