? serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/.HttpProxyUpdater.java.swp ? serverplugins/sun/appsrv81/test/lib ? serverplugins/sun/appsrv81/test/results ? serverplugins/sun/appsrv81/test/work Index: serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/DomainEditor.java =================================================================== RCS file: /cvs/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/Attic/DomainEditor.java,v retrieving revision 1.1.2.5 diff -u -r1.1.2.5 DomainEditor.java --- serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/DomainEditor.java 25 Apr 2006 21:47:53 -0000 1.1.2.5 +++ serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/DomainEditor.java 5 May 2006 16:12:45 -0000 @@ -59,6 +59,7 @@ private static DeploymentManager dm; private static String HTTP_PROXY_HOST = "-Dhttp.proxyHost="; private static String HTTP_PROXY_PORT = "-Dhttp.proxyPort="; + private static String HTTP_PROXY_NO_HOST = "-Dhttp.nonProxyHosts="; private static String HTTPS_PROXY_HOST = "-Dhttps.proxyHost="; private static String HTTPS_PROXY_PORT = "-Dhttps.proxyPort="; @@ -207,6 +208,7 @@ String childValue = childNode.getNodeValue(); if(childValue.indexOf(HTTP_PROXY_HOST) != -1 || childValue.indexOf(HTTP_PROXY_PORT) != -1 + || childValue.indexOf(HTTP_PROXY_NO_HOST) != -1 || childValue.indexOf(HTTPS_PROXY_HOST) != -1 || childValue.indexOf(HTTPS_PROXY_PORT) != -1){ httpProxyOptions.add(childValue); @@ -252,6 +254,7 @@ String childValue = childNode.getNodeValue(); if(childValue.indexOf(HTTP_PROXY_HOST) != -1 || childValue.indexOf(HTTP_PROXY_PORT) != -1 + || childValue.indexOf(HTTP_PROXY_NO_HOST) != -1 || childValue.indexOf(HTTPS_PROXY_HOST) != -1 || childValue.indexOf(HTTPS_PROXY_PORT) != -1){ nodes.add(nd); Index: serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/HttpProxyUpdater.java =================================================================== RCS file: /cvs/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/Attic/HttpProxyUpdater.java,v retrieving revision 1.1.2.3 diff -u -r1.1.2.3 HttpProxyUpdater.java --- serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/HttpProxyUpdater.java 15 Apr 2006 08:06:43 -0000 1.1.2.3 +++ serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/HttpProxyUpdater.java 5 May 2006 16:12:45 -0000 @@ -32,10 +32,12 @@ public class HttpProxyUpdater { private String httpProxyPort; private String httpProxyHost; + private String httpProxyNoHost; private String httpsProxyPort; private String httpsProxyHost; private static String HTTP_PROXY_HOST = "-Dhttp.proxyHost="; private static String HTTP_PROXY_PORT = "-Dhttp.proxyPort="; + private static String HTTP_PROXY_NO_HOST = "-Dhttp.nonProxyHosts="; private static String HTTPS_PROXY_HOST = "-Dhttps.proxyHost="; private static String HTTPS_PROXY_PORT = "-Dhttps.proxyPort="; private static String JVM_OPTIONS = "jvm-options"; @@ -143,6 +145,7 @@ private boolean removeProxy() { boolean changed = removeProperty(HTTP_PROXY_HOST); changed |= removeProperty(HTTP_PROXY_PORT); + changed |= removeProperty(HTTP_PROXY_NO_HOST); changed |= removeProperty(HTTPS_PROXY_HOST); changed |= removeProperty(HTTPS_PROXY_PORT); return changed; @@ -161,11 +164,18 @@ if (port.trim().length() == 0) { port = null; } + String nonHosts = System.getProperty("http.nonProxyHosts", ""); //NOI18N + if (nonHosts.trim().length() != 0) { + // the property might contain spaces like -Dhttp.nonProxyHosts= localhost localhost.czech.sun.com + nonHosts = "\"" + nonHosts + "\""; // NOI18N + } else { + nonHosts = null; + } if(this.serverRunning){ try{ getOptionsFromServer(); - if (host == null || port == null) { + if (host == null || port == null || nonHosts == null) { removeOptionsFromServer(); return; } @@ -173,7 +183,7 @@ throw new Exception(bundle.getString("Err_CannotUpdateProxy")); } checkProxyInfo(host, port); - if (updateOptions(host, port)) { + if (updateOptions(host, port, nonHosts)) { try{ setOptionsToServer(); }catch(Exception ex){ @@ -184,12 +194,12 @@ }else{ //Manipulate domain.xml since server is stopped getOptionsFromXml(); - if (host == null || port == null) { + if (host == null || port == null ) { removeOptionsFromXml(); return; } checkProxyInfo(host, port); - if (updateOptions(host, port)) { + if (updateOptions(host, port, nonHosts)) { setOptionsToXml(); } // end of if (changed) } @@ -210,7 +220,7 @@ } private void removeOptionsFromXml() { - if (httpProxyHost != null || httpProxyPort != null || + if (httpProxyHost != null || httpProxyPort != null || httpProxyNoHost != null || httpsProxyHost != null || httpsProxyPort != null) { if (removeProxy()) { setOptionsToXml(); @@ -220,7 +230,7 @@ private void removeOptionsFromServer() throws Exception { try{ - if (httpProxyHost != null || httpProxyPort != null || + if (httpProxyHost != null || httpProxyPort != null || httpProxyNoHost != null || httpsProxyHost != null || httpsProxyPort != null) { if (removeProxy()) { try{ @@ -235,7 +245,7 @@ } } //Err_CannotUpdateProxy - private boolean updateOptions(String host, String port){ + private boolean updateOptions(String host, String port, String nonHosts){ boolean changed = false; if (!host.equals(httpProxyHost)) { @@ -248,6 +258,11 @@ changed = true; } // end of if (!port.equals(httpProxyPort)) + if (!nonHosts.equals(httpProxyNoHost)) { + setProperty(HTTP_PROXY_NO_HOST, nonHosts); + changed = true; + } // end of if (!nonHosts.equals(httpProxyNoHost)) + if (!host.equals(httpsProxyHost)) { setProperty(HTTPS_PROXY_HOST, host); changed = true; @@ -269,6 +284,8 @@ httpProxyHost = option.substring(HTTP_PROXY_HOST.length()); } else if (option.startsWith(HTTP_PROXY_PORT)) { httpProxyPort = option.substring(HTTP_PROXY_PORT.length()); + }else if (option.startsWith(HTTP_PROXY_NO_HOST)) { + httpProxyNoHost = option.substring(HTTP_PROXY_NO_HOST.length()); } else if (option.startsWith(HTTPS_PROXY_HOST)) { httpsProxyHost = option.substring(HTTPS_PROXY_HOST.length()); } else if (option.startsWith(HTTPS_PROXY_PORT)) {