< prev index next >

src/java.base/share/classes/java/net/HttpRetryException.java

Print this page




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.net;
  27 
  28 import java.io.IOException;
  29 
  30 /**
  31  * Thrown to indicate that a HTTP request needs to be retried
  32  * but cannot be retried automatically, due to streaming mode
  33  * being enabled.
  34  *
  35  * @author  Michael McMahon
  36  * @since   1.5
  37  */
  38 public
  39 class HttpRetryException extends IOException {

  40     private static final long serialVersionUID = -9186022286469111381L;
  41 
  42     private int responseCode;
  43     private String location;
  44 
  45     /**
  46      * Constructs a new {@code HttpRetryException} from the
  47      * specified response code and exception detail message
  48      *
  49      * @param   detail   the detail message.
  50      * @param   code   the HTTP response code from server.
  51      */
  52     public HttpRetryException(String detail, int code) {
  53         super(detail);
  54         responseCode = code;
  55     }
  56 
  57     /**
  58      * Constructs a new {@code HttpRetryException} with detail message
  59      * responseCode and the contents of the Location response header field.




  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.net;
  27 
  28 import java.io.IOException;
  29 
  30 /**
  31  * Thrown to indicate that a HTTP request needs to be retried
  32  * but cannot be retried automatically, due to streaming mode
  33  * being enabled.
  34  *
  35  * @author  Michael McMahon
  36  * @since   1.5
  37  */
  38 public
  39 class HttpRetryException extends IOException {
  40     @java.io.Serial
  41     private static final long serialVersionUID = -9186022286469111381L;
  42 
  43     private int responseCode;
  44     private String location;
  45 
  46     /**
  47      * Constructs a new {@code HttpRetryException} from the
  48      * specified response code and exception detail message
  49      *
  50      * @param   detail   the detail message.
  51      * @param   code   the HTTP response code from server.
  52      */
  53     public HttpRetryException(String detail, int code) {
  54         super(detail);
  55         responseCode = code;
  56     }
  57 
  58     /**
  59      * Constructs a new {@code HttpRetryException} with detail message
  60      * responseCode and the contents of the Location response header field.


< prev index next >