|
|
@@ -29,7 +29,11 @@ public class HttpClient {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- return client.syncSend(request);
|
|
|
+ try {
|
|
|
+ return client.syncSend(request);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public FullHttpResponse post(String uri, List<DockerHeader> headers) {
|
|
|
@@ -42,7 +46,11 @@ public class HttpClient {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- return client.syncSend(request);
|
|
|
+ try {
|
|
|
+ return client.syncSend(request);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public FullHttpResponse postJson(String uri, List<DockerHeader> headers, String json) {
|
|
|
@@ -60,7 +68,11 @@ public class HttpClient {
|
|
|
}
|
|
|
request.content().clear().writeBytes(byteBuf);
|
|
|
|
|
|
- return client.syncSend(request);
|
|
|
+ try {
|
|
|
+ return client.syncSend(request);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public FullHttpResponse postFile(String uri, List<DockerHeader> headers, File file) {
|
|
|
@@ -82,9 +94,8 @@ public class HttpClient {
|
|
|
return client.syncSend(request);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ return null;
|
|
|
}
|
|
|
-
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
private byte[] transfer(File file) throws IOException {
|
|
|
@@ -110,7 +121,11 @@ public class HttpClient {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- return client.syncSend(request);
|
|
|
+ try {
|
|
|
+ return client.syncSend(request);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void close() {
|