예제 #1
0
 private void setProxy() {
   String proxyHost = null;
   String proxyPort = null;
   if (applicationProperties.containsKey(Constants.PROXY_HOST)) {
     proxyHost = applicationProperties.getProperty(Constants.PROXY_HOST).trim();
   }
   if (applicationProperties.containsKey(Constants.PROXY_PORT)) {
     proxyPort = applicationProperties.getProperty(Constants.PROXY_PORT).trim();
   }
   if (proxyHost != null && !proxyHost.isEmpty()) {
     int port = 0;
     if (proxyPort != null && !proxyPort.isEmpty()) {
       try {
         port = Integer.parseInt(proxyPort);
       } catch (NumberFormatException ne) {
         LOG.warn("Proxy port is not an integer in configuration");
       }
     }
     HttpUtil.setProxyConfig(proxyHost, port);
   }
 }