From ed108609969d1fcdd15c879bbab0c27474a00c21 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 May 2017 17:45:04 +0900 Subject: [PATCH 1/2] enable proxy setting --- javasource/restservices/consume/RestConsumer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/javasource/restservices/consume/RestConsumer.java b/javasource/restservices/consume/RestConsumer.java index 84ffb03..281111e 100644 --- a/javasource/restservices/consume/RestConsumer.java +++ b/javasource/restservices/consume/RestConsumer.java @@ -268,6 +268,9 @@ else if ("PUT".equals(method)) else if (request instanceof PutMethod && requestEntity != null) ((PutMethod)request).setRequestEntity(requestEntity); + if ((System.getProperty("http.proxyHost") != null) && (!"".equals(System.getProperty("http.proxyHost")))) { + client.getHostConfiguration().setProxy(System.getProperty("http.proxyHost"), Integer.valueOf(System.getProperty("http.proxyPort"))); + } int status = client.executeMethod(request); Header responseEtag = request.getResponseHeader(RestServices.HEADER_ETAG); From 2394f627d0597dd00932cd13441e6da437d663af Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2017 08:53:38 +0900 Subject: [PATCH 2/2] use Commons Lang StringUtils --- javasource/restservices/consume/RestConsumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javasource/restservices/consume/RestConsumer.java b/javasource/restservices/consume/RestConsumer.java index 281111e..51cac93 100644 --- a/javasource/restservices/consume/RestConsumer.java +++ b/javasource/restservices/consume/RestConsumer.java @@ -268,7 +268,7 @@ else if ("PUT".equals(method)) else if (request instanceof PutMethod && requestEntity != null) ((PutMethod)request).setRequestEntity(requestEntity); - if ((System.getProperty("http.proxyHost") != null) && (!"".equals(System.getProperty("http.proxyHost")))) { + if (!org.apache.commons.lang.StringUtils.isEmpty(System.getProperty("http.proxyHost"))) { client.getHostConfiguration().setProxy(System.getProperty("http.proxyHost"), Integer.valueOf(System.getProperty("http.proxyPort"))); } int status = client.executeMethod(request);