detect expired session on connection details

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@551 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-04-08 07:13:15 +00:00
parent b4ffd39c0b
commit 03ee7a6cff

View file

@ -466,6 +466,7 @@ public final class BvgProvider extends AbstractHafasProvider
+ "([^\n]*)\n" //
+ "</a>\n" //
+ "&nbsp;(\\d{1,2}:\\d{2})&nbsp;\n", Pattern.DOTALL);
private static final Pattern P_CONNECTION_DETAILS_ERROR = Pattern.compile("(zwischenzeitlich nicht mehr gespeichert)", Pattern.CASE_INSENSITIVE);
@Override
public GetConnectionDetailsResult getConnectionDetails(final String uri) throws IOException
@ -487,6 +488,10 @@ public final class BvgProvider extends AbstractHafasProvider
}
}
final Matcher mError = P_CONNECTION_DETAILS_ERROR.matcher(page);
if (mError.find())
throw new SessionExpiredException();
final Matcher mHead = P_CONNECTION_DETAILS_HEAD.matcher(page);
if (mHead.matches())
{