Ignore:
Timestamp:
2011-04-18T19:39:15+12:00 (13 years ago)
Author:
ak19
Message:

Two fixes: 1. Dr Bainbridge noticed the Date object used in OAIXML.java's getTime() accepted time in milliseconds, not seconds as the long parameter contained when called from OAIPMH (other classes calling OAIXML.getTime() called it correctly in milliseconds. 2. Fixed error in OAIServer.getPost where I wasn't resetting the new member variable queryString, which was breaking future doGet requests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java

    r23913 r23922  
    239239        Element token_elem = (Element)tokens.item(i);
    240240        String expire_str = token_elem.getAttribute(EXPIRATION_DATE);
    241         long datestamp = getTime(expire_str);
     241        long datestamp = getTime(expire_str); // expire_str is in milliseconds
    242242        if(datestamp < System.currentTimeMillis()) {
    243243          resumption_token_elem.removeChild(token_elem);
     
    360360   
    361361    public static long getTokenExpiration() {
    362       return token_expiration*1000;
     362    return token_expiration*1000; // in milliseconds
    363363    }
    364364
     
    520520    /** get the string representation of a time from a long value(long type)
    521521     */
    522     public static String getTime(long seconds) {
    523       Date date = new Date(seconds);
     522    public static String getTime(long milliseconds) {
     523      Date date = new Date(milliseconds);
    524524      SimpleDateFormat sdf = new SimpleDateFormat(granularity);
    525525      return sdf.format(date);
Note: See TracChangeset for help on using the changeset viewer.