@@ -99,11 +99,11 @@ public static int remotePost(String[] args) throws Exception {
99
99
if (!home .endsWith ("/" )) home = home + '/' ; // make sure it ends with '/'
100
100
101
101
// check for authentication info
102
- String auth = new URI (home ).getUserInfo ();
102
+ String auth = new URL (home ).getUserInfo ();
103
103
if (auth != null ) auth = "Basic " + new Base64Encoder ().encode (auth .getBytes (StandardCharsets .UTF_8 ));
104
104
105
105
{ // check if the home is set correctly
106
- HttpURLConnection con = open (new URI (home ));
106
+ HttpURLConnection con = open (new URL (home ));
107
107
if (auth != null ) con .setRequestProperty ("Authorization" , auth );
108
108
con .connect ();
109
109
if (con .getResponseCode () != 200
@@ -113,10 +113,10 @@ public static int remotePost(String[] args) throws Exception {
113
113
}
114
114
}
115
115
116
- URL jobURL = new URI (home + "job/" + Util .encode (projectName ).replace ("/" , "/job/" ) + "/" );
116
+ URL jobURL = new URL (home + "job/" + Util .encode (projectName ).replace ("/" , "/job/" ) + "/" );
117
117
118
118
{ // check if the job name is correct
119
- HttpURLConnection con = open (new URI (jobURL , "acceptBuildResult" ));
119
+ HttpURLConnection con = open (new URL (jobURL , "acceptBuildResult" ));
120
120
if (auth != null ) con .setRequestProperty ("Authorization" , auth );
121
121
con .connect ();
122
122
if (con .getResponseCode () != 200 ) {
@@ -128,7 +128,7 @@ public static int remotePost(String[] args) throws Exception {
128
128
// get a crumb to pass the csrf check
129
129
String crumbField = null , crumbValue = null ;
130
130
try {
131
- HttpURLConnection con = open (new URI (home +
131
+ HttpURLConnection con = open (new URL (home +
132
132
"crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\" :\" ,//crumb)'" ));
133
133
if (auth != null ) con .setRequestProperty ("Authorization" , auth );
134
134
String line = IOUtils .readFirstLine (con .getInputStream (), "UTF-8" );
@@ -165,7 +165,7 @@ public static int remotePost(String[] args) throws Exception {
165
165
throw new IOException (e );
166
166
}
167
167
168
- URL location = new URI (jobURL , "postBuildResult" );
168
+ URL location = new URL (jobURL , "postBuildResult" );
169
169
while (true ) {
170
170
try {
171
171
// start a remote connection
@@ -193,7 +193,7 @@ public static int remotePost(String[] args) throws Exception {
193
193
} catch (HttpRetryException e ) {
194
194
if (e .getLocation () != null ) {
195
195
// retry with the new location
196
- location = new URI (e .getLocation ());
196
+ location = new URL (e .getLocation ());
197
197
continue ;
198
198
}
199
199
// otherwise failed for reasons beyond us.
0 commit comments