Package org.xnio.http
Class RedirectException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.xnio.http.RedirectException
- All Implemented Interfaces:
Serializable
An extension of
IOException used to convey that a connection has failed as a redirect has been encountered.- Author:
- Darran Lofthouse
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRedirectException(int statusCode, String location) Constructs a newRedirectExceptioninstance.RedirectException(String msg, int statusCode, String location) Constructs a newRedirectExceptioninstance with an initial message.RedirectException(String msg, Throwable cause, int statusCode, String location) Constructs a newRedirectExceptioninstance with an initial message and cause.RedirectException(Throwable cause, int statusCode, String location) Constructs a newRedirectExceptioninstance with an initial cause. -
Method Summary
Modifier and TypeMethodDescriptionGet the redirection target location.intGet the HTTP status code.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RedirectException
Constructs a newRedirectExceptioninstance. The message is left blank (null), and no cause is specified.- Parameters:
statusCode- the status codelocation- the redirection location, if any
-
RedirectException
Constructs a newRedirectExceptioninstance with an initial message. No cause is specified.- Parameters:
msg- the messagestatusCode- the status codelocation- the redirection location, if any
-
RedirectException
Constructs a newRedirectExceptioninstance with an initial cause. If a non-nullcause is specified, its message is used to initialize the message of thisRedirectException; otherwise the message is left blank (null).- Parameters:
cause- the causestatusCode- the status codelocation- the redirection location, if any
-
RedirectException
Constructs a newRedirectExceptioninstance with an initial message and cause.- Parameters:
msg- the messagecause- the causestatusCode- the status codelocation- the redirection location, if any
-
-
Method Details
-
getStatusCode
public int getStatusCode()Get the HTTP status code. This is the reason for the redirect.- Returns:
- the status code
-
getLocation
Get the redirection target location.- Returns:
- the redirection target location
-