document.write('<div class="java5" style="font-family: monospace;"><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"><span style="color: #aaaadd; font-weight: bold;">String</span></a> proxyHost = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;proxyHost&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"><span style="color: #aaaadd; font-weight: bold;">String</span></a> proxyPort = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;proxyPort&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"><span style="color: #aaaadd; font-weight: bold;">String</span></a> nonProxyHosts = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;nonProxyHosts&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>proxyHost != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// set standard proxy property</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.proxyHost&quot;</span>, proxyHost<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>proxyHost = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.proxyHost&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// standard proxy property is set -&gt; just in case some software expects it,</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// use it also for deprecated proxy property</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;proxyHost&quot;</span>, proxyHost<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>proxyHost = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;deployment.proxy.http.host&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// javaws proxy property is set -&gt;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// use it also for standard and deprecated proxy property</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;proxyHost&quot;</span>, proxyHost<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.proxyHost&quot;</span>, proxyHost<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; <br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>proxyPort != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// set standard proxy property</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.proxyPort&quot;</span>, proxyPort<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>proxyPort = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.proxyPort&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// standard proxy property is set -&gt; just in case some software expects it,</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// use it also for deprecated proxy property</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;proxyPort&quot;</span>, proxyPort<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>proxyPort = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;deployment.proxy.http.port&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;proxyPort&quot;</span>, proxyPort<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.proxyPort&quot;</span>, proxyPort<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// set nonproxy hosts (deprecated and standard property)</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>nonProxyHosts == <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span> nonProxyHosts = <br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.nonProxyHosts&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"><span style="color: #aaaadd; font-weight: bold;">String</span></a> proxyBypassList = <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;deployment.proxy.bypass.list&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>nonProxyHosts == <span style="color: #b13366;">null</span> &amp;&amp; proxyBypassList != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nonProxyHosts = proxyBypassList.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">\';\'</span>, <span style="color: #ff0000;">\'|\'</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; nonProxyHosts = updateNonProxyHosts<span style="color: #66cc66;">&#40;</span>isProxyEnabled<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, nonProxyHosts<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>nonProxyHosts != <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;nonProxyHosts&quot;</span>, nonProxyHosts<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http.nonProxyHosts&quot;</span>, nonProxyHosts<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxyBypassList = nonProxyHosts.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">\'|\'</span>, <span style="color: #ff0000;">\';\'</span><span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a target="_blank"&nbsp; href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">setProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;deployment.proxy.bypass.list&quot;</span>, proxyBypassList<span style="color: #66cc66;">&#41;</span>;<br />');
document.write('&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />');
document.write('<br />');
document.write('&nbsp;</div>');
document.write('<br />&nbsp;<br /><div style="font-size: 12px">Brought to you by the community at <a href="http://www.bytemycode.com/snippets/snippet/211/3/" target="_blank">byteMyCode</a>.</div>');
