Package java.net

Class HttpRetryException

  • All Implemented Interfaces:
    Serializable

    public class HttpRetryException
    extends IOException
    If a HTTP request has to be retried, this exception will be thrown if the request cannot be retried automatically.
    See Also:
    Serialized Form
    • Constructor Detail

      • HttpRetryException

        public HttpRetryException​(String detail,
                                  int code)
        Creates a new HttpRetryException instance with the specified response code and the given detail message.
        Parameters:
        detail - the detail message for this exception.
        code - the HTTP response code from target host.
      • HttpRetryException

        public HttpRetryException​(String detail,
                                  int code,
                                  String location)
        Creates a new HttpRetryException instance with the specified response code, the given detail message and the value of the location field from the response header.
        Parameters:
        detail - the detail message for this exception.
        code - the HTTP response code from target host.
        location - the destination URL of the redirection.
    • Method Detail

      • getLocation

        public String getLocation()
        Gets the location value.
        Returns:
        the stored location from the HTTP header.
      • getReason

        public String getReason()
        Gets the detail message.
        Returns:
        the detail message.
      • responseCode

        public int responseCode()
        Gets the response code.
        Returns:
        the HTTP response code.