List of usage examples for org.apache.http.impl.cookie DateParseException DateParseException
public DateParseException(final String message)
From source file:edu.mit.mobile.android.locast.sync.SyncEngine.java
/** * Gets the server's time.//ww w. ja va 2 s .co m * * @param hr * @return the time that the response was generated, according to the server * @throws DateParseException * if the header is missing or if it can't be parsed. */ private long getServerTime(HttpResponse hr) throws DateParseException { final Header hDate = hr.getFirstHeader("Date"); if (hDate == null) { throw new DateParseException("No Date header in http response"); } return DateUtils.parseDate(hDate.getValue()).getTime(); }