1717
1818package org .apache .zeppelin .test ;
1919
20- import java .net .MalformedURLException ;
2120import java .net .URL ;
2221import java .util .Optional ;
2322
2423public class DownloadRequest {
24+
2525 private final URL url ;
2626 private final Optional <URL > alternativeUrl ;
2727 private final int retries ;
2828
2929 public static final int DEFAULT_RETRIES = 3 ;
3030
31- public DownloadRequest (String url , int retries ) throws MalformedURLException {
32- this (url , null , retries );
33- }
34-
35- public DownloadRequest (String url , String alternativeUrl ) throws MalformedURLException {
36- this (url , alternativeUrl , DEFAULT_RETRIES );
37- }
38-
39- public DownloadRequest (String url , String alternativeUrl , int retries )
40- throws MalformedURLException {
41- if (alternativeUrl != null ) {
42- this .url = new URL (url );
43- this .alternativeUrl = Optional .of (new URL (alternativeUrl ));
44- this .retries = retries ;
45- } else {
46- this .url = new URL (url );
47- this .alternativeUrl = Optional .empty ();
48- this .retries = retries ;
49- }
50- }
51-
52- public DownloadRequest (URL url , int retries ) {
53- this (url , null , retries );
54- }
55-
5631 public DownloadRequest (URL url , URL alternativeUrl ) {
5732 this (url , alternativeUrl , DEFAULT_RETRIES );
5833 }
@@ -75,3 +50,4 @@ public int getRetries() {
7550 return retries ;
7651 }
7752}
53+
0 commit comments