File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1919import java .io .Serializable ;
2020import java .net .HttpURLConnection ;
2121import java .nio .charset .Charset ;
22+ import java .time .Duration ;
2223import java .util .Arrays ;
2324import java .util .Collection ;
2425import java .util .Collections ;
@@ -373,6 +374,22 @@ public Options(int connectTimeoutMillis, int readTimeoutMillis) {
373374 this (connectTimeoutMillis , readTimeoutMillis , true );
374375 }
375376
377+ /**
378+ * Creates a new Options Instance.
379+ *
380+ * @param connectTimeout value.
381+ * @param readTimeout value.
382+ * @param followRedirects if the request should follow 3xx redirections.
383+ */
384+ public Options (Duration connectTimeout , Duration readTimeout , boolean followRedirects ) {
385+ this (
386+ connectTimeout .toMillis (),
387+ TimeUnit .MILLISECONDS ,
388+ readTimeout .toMillis (),
389+ TimeUnit .MILLISECONDS ,
390+ followRedirects );
391+ }
392+
376393 /**
377394 * Creates the new Options instance using the following defaults:
378395 *
You can’t perform that action at this time.
0 commit comments