01: package net.sf.regain.crawler;
02:
03: import net.sf.regain.RegainException;
04:
05: /**
06: * Used for handling HTTP redirects.
07: *
08: * @see net.sf.regain.crawler.CrawlerToolkit#getHttpStream(java.net.URL)
09: * @author Gerhard Olsson
10: */
11: public class RedirectException extends RegainException {
12:
13: /** Extra info, for instance redirectUrl */
14: private String mRedirectUrl;
15:
16: /**
17: * Creates a new instance of RedirectException.
18: *
19: * @param message The error message.
20: * @param url The URL the redirect points to.
21: */
22: public RedirectException(String message, String url) {
23: super (message);
24:
25: mRedirectUrl = url;
26: }
27:
28: /**
29: * Gets the redirectUrl of this exception. (May be null)
30: *
31: * @return The extra info of this exception.
32: */
33: public String getRedirectUrl() {
34: return mRedirectUrl;
35: }
36:
37: }
|