Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 368
نمايش فراداده

HttpRetryExceptionjava.net

Java 5.0serializable checked

An exception of this type is thrown when an HTTP request needs to be retried (due to a server redirect or authentication request, for example) but the protocol handler cannot automatically retry it because the HttpURLConnection has been placed in streaming mode. (See the setFixedLengthStreamingMode( ) and setChunkedStreamingMode( ) methods of HttpURLConnection.) The methods of the exception provide details about how the request should be retried.

Figure 12-4. java.net.HttpRetryException

public class

HttpRetryException extends java.io.IOException { // Public Constructors public

HttpRetryException (String

detail , int

code ); public

HttpRetryException (String

detail , int

code , String

location ); // Public Instance Methods public String

getLocation ( ); public String

getReason ( ); public int

responseCode ( ); }