mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 22:19:50 +00:00
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:
parent
b4ffd39c0b
commit
03ee7a6cff
1 changed files with 5 additions and 0 deletions
|
@ -466,6 +466,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
+ "([^\n]*)\n" //
|
+ "([^\n]*)\n" //
|
||||||
+ "</a>\n" //
|
+ "</a>\n" //
|
||||||
+ " (\\d{1,2}:\\d{2}) \n", Pattern.DOTALL);
|
+ " (\\d{1,2}:\\d{2}) \n", Pattern.DOTALL);
|
||||||
|
private static final Pattern P_CONNECTION_DETAILS_ERROR = Pattern.compile("(zwischenzeitlich nicht mehr gespeichert)", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GetConnectionDetailsResult getConnectionDetails(final String uri) throws IOException
|
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);
|
final Matcher mHead = P_CONNECTION_DETAILS_HEAD.matcher(page);
|
||||||
if (mHead.matches())
|
if (mHead.matches())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue