Package java.net
Class HttpRetryException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- java.net.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 Summary
Constructors Constructor Description HttpRetryException(String detail, int code)Creates a newHttpRetryExceptioninstance with the specified response code and the given detail message.HttpRetryException(String detail, int code, String location)Creates a newHttpRetryExceptioninstance with the specified response code, the given detail message and the value of the location field from the response header.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLocation()Gets the location value.StringgetReason()Gets the detail message.intresponseCode()Gets the response code.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
HttpRetryException
public HttpRetryException(String detail, int code)
Creates a newHttpRetryExceptioninstance 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 newHttpRetryExceptioninstance 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.
-
-