#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    52
    Rep Power
    13

    Comparing timestamp


    I have an applet which downloads reads a file from server & displays. The applet gets refreshed after every 2 min, & if there isany change in the file it should display the new file. I am using URLConnection & it supports getLastModified() function. But how do i compare the timestamp of the same file.
    Thanks
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Code:
    long oldTime = null;
    long newTime = null;
    newTime = daUrl.getLastModified()
    if ( oldTime != newTime ) {
      oldTime = newTime;
      ... reload file ...
    }

IMN logo majestic logo threadwatch logo seochat tools logo