Changeset 23922
- Timestamp:
- 2011-04-18T19:39:15+12:00 (13 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/OAIServer.java
r23913 r23922 288 288 // if called by doPost (if this was originally a POST request), var queryString would have been set 289 289 String query = (queryString == null) ? request.getQueryString() : queryString; 290 queryString = null; // reset member variable, else no doGet will work as long as the server remains running 291 290 292 String[] pairs = (query==null)? null : query.split("&");//split into key/value pairs 291 293 String verb = getVerb(query); … … 413 415 if(queryString.length() > 0) { 414 416 queryString = queryString.substring(1); 415 //queryString = java.net.URLEncoder.encode(queryString,"UTF-8");417 //queryString = OAIXML.oaiEncode(queryString); 416 418 } 417 419 if(queryString.equals("")) { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/OAIPMH.java
r22974 r23922 256 256 if(keys.contains(OAIXML.LASTMODIFIED)) { 257 257 lastmodified = info.getInfo(OAIXML.LASTMODIFIED); 258 }259 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));258 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified)*1000); // java wants dates in milliseconds 259 } 260 260 261 261 Element get_record = OAIXML.createElement(OAIXML.GET_RECORD); … … 335 335 if(keys.contains(OAIXML.LASTMODIFIED)) { 336 336 lastmodified = info.getInfo(OAIXML.LASTMODIFIED); 337 } 338 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));337 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified)*1000); // java wants dates in milliseconds 338 } 339 339 340 340 Date this_date = OAIXML.getDate(lastmodified); … … 421 421 if(keys.contains(OAIXML.LASTMODIFIED)) { 422 422 lastmodified = info.getInfo(OAIXML.LASTMODIFIED); 423 } 424 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified));423 lastmodified = OAIXML.getTime(Long.parseLong(lastmodified)*1000); // java wants dates in milliseconds 424 } 425 425 426 426 Date this_date = OAIXML.getDate(lastmodified); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java
r23913 r23922 239 239 Element token_elem = (Element)tokens.item(i); 240 240 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 242 242 if(datestamp < System.currentTimeMillis()) { 243 243 resumption_token_elem.removeChild(token_elem); … … 360 360 361 361 public static long getTokenExpiration() { 362 return token_expiration*1000; 362 return token_expiration*1000; // in milliseconds 363 363 } 364 364 … … 520 520 /** get the string representation of a time from a long value(long type) 521 521 */ 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); 524 524 SimpleDateFormat sdf = new SimpleDateFormat(granularity); 525 525 return sdf.format(date);
Note:
See TracChangeset
for help on using the changeset viewer.