Re: Help clearing http.proxyHost system propery

From: Raymond DeCampo (rdecampo_at_spam.twcny.spam.rr.spam.com.spam)
Date: 04/25/04


Date: Sun, 25 Apr 2004 18:22:18 GMT

George Orwell wrote:
>
> But if I want to clear the value,
>
> System.setProperty("http.proxyHost",null)
>
> or
>
> String proxy = null
> System.setProperty("http.proxyHost",proxy)
>
> doesnt seem to work.
>
> I end up with a NullPointerExcption at java.util.Hashtable.put
>
> Does anyone have a solution for this? Thanks in advance.
>

George,

Use System.getProperties() to get the Properties object itself. Then
you can clear the value directly using the Properties API. It may be
necessary to call System.setProperties() afterward, as the documentation
is not clear whether the System.getProperties() method returns the
actual system Properties object or a copy.

Ray