diff --git a/enabler/src/de/schildbach/pte/AbstractEfaProvider.java b/enabler/src/de/schildbach/pte/AbstractEfaProvider.java index 0708f08f..9bc87eae 100644 --- a/enabler/src/de/schildbach/pte/AbstractEfaProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractEfaProvider.java @@ -17,7 +17,6 @@ package de.schildbach.pte; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.Serializable; @@ -70,7 +69,6 @@ import de.schildbach.pte.dto.SuggestLocationsResult; import de.schildbach.pte.dto.Trip; import de.schildbach.pte.exception.InvalidDataException; import de.schildbach.pte.exception.ParserException; -import de.schildbach.pte.exception.SessionExpiredException; import de.schildbach.pte.util.ParserUtils; import de.schildbach.pte.util.XmlPullUtil; @@ -2256,10 +2254,6 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider { throw new ParserException("cannot parse xml: " + firstChars, x); } - catch (final FileNotFoundException x) - { - throw new SessionExpiredException(); - } catch (final RuntimeException x) { throw new RuntimeException("uncategorized problem while processing " + uri, x); diff --git a/enabler/src/de/schildbach/pte/exception/NotFoundException.java b/enabler/src/de/schildbach/pte/exception/NotFoundException.java new file mode 100644 index 00000000..57c47c4c --- /dev/null +++ b/enabler/src/de/schildbach/pte/exception/NotFoundException.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014 the original author or authors. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package de.schildbach.pte.exception; + +import java.io.Reader; +import java.net.URL; + +/** + * @author Andreas Schildbach + */ +public class NotFoundException extends AbstractHttpException +{ + public NotFoundException(final URL url, final Reader errorReader) + { + super(url, errorReader); + } +} diff --git a/enabler/src/de/schildbach/pte/util/ParserUtils.java b/enabler/src/de/schildbach/pte/util/ParserUtils.java index 441f3af4..294f552a 100644 --- a/enabler/src/de/schildbach/pte/util/ParserUtils.java +++ b/enabler/src/de/schildbach/pte/util/ParserUtils.java @@ -18,7 +18,6 @@ package de.schildbach.pte.util; import java.io.BufferedInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -42,6 +41,7 @@ import java.util.zip.GZIPInputStream; import de.schildbach.pte.exception.BlockedException; import de.schildbach.pte.exception.InternalErrorException; +import de.schildbach.pte.exception.NotFoundException; import de.schildbach.pte.exception.SessionExpiredException; import de.schildbach.pte.exception.UnexpectedRedirectException; @@ -197,7 +197,7 @@ public final class ParserUtils } else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { - throw new FileNotFoundException(url.toString()); + throw new NotFoundException(url, new InputStreamReader(connection.getErrorStream(), requestEncoding)); } else if (responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP) {