Module 
Package org.xnio.http

Class RedirectException

  • All Implemented Interfaces:
    java.io.Serializable

    public class RedirectException
    extends java.io.IOException
    An extension of IOException used to convey that a connection has failed as a redirect has been encountered.
    Author:
    Darran Lofthouse
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      RedirectException​(int statusCode, java.lang.String location)
      Constructs a new RedirectException instance.
      RedirectException​(java.lang.String msg, int statusCode, java.lang.String location)
      Constructs a new RedirectException instance with an initial message.
      RedirectException​(java.lang.String msg, java.lang.Throwable cause, int statusCode, java.lang.String location)
      Constructs a new RedirectException instance with an initial message and cause.
      RedirectException​(java.lang.Throwable cause, int statusCode, java.lang.String location)
      Constructs a new RedirectException instance with an initial cause.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLocation()
      Get the redirection target location.
      int getStatusCode()
      Get the HTTP status code.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RedirectException

        public RedirectException​(int statusCode,
                                 java.lang.String location)
        Constructs a new RedirectException instance. The message is left blank (null), and no cause is specified.
        Parameters:
        statusCode - the status code
        location - the redirection location, if any
      • RedirectException

        public RedirectException​(java.lang.String msg,
                                 int statusCode,
                                 java.lang.String location)
        Constructs a new RedirectException instance with an initial message. No cause is specified.
        Parameters:
        msg - the message
        statusCode - the status code
        location - the redirection location, if any
      • RedirectException

        public RedirectException​(java.lang.Throwable cause,
                                 int statusCode,
                                 java.lang.String location)
        Constructs a new RedirectException instance with an initial cause. If a non-null cause is specified, its message is used to initialize the message of this RedirectException; otherwise the message is left blank (null).
        Parameters:
        cause - the cause
        statusCode - the status code
        location - the redirection location, if any
      • RedirectException

        public RedirectException​(java.lang.String msg,
                                 java.lang.Throwable cause,
                                 int statusCode,
                                 java.lang.String location)
        Constructs a new RedirectException instance with an initial message and cause.
        Parameters:
        msg - the message
        cause - the cause
        statusCode - the status code
        location - the redirection location, if any
    • Method Detail

      • getStatusCode

        public int getStatusCode()
        Get the HTTP status code. This is the reason for the redirect.
        Returns:
        the status code
      • getLocation

        public java.lang.String getLocation()
        Get the redirection target location.
        Returns:
        the redirection target location