diff options
| author | David Daney <ddaney@avtrex.com> | 2006-02-27 18:48:56 +0000 |
|---|---|---|
| committer | David Daney <ddaney@avtrex.com> | 2006-02-27 18:48:56 +0000 |
| commit | fd01df1788740627e68faaa32bb26521095821c9 (patch) | |
| tree | 629078fc1c9faac6f6777b5409469ebff661df63 /gnu/java/net/protocol/http | |
| parent | 51835350545da69f37a2d79d20dff95dbacf4d2c (diff) | |
| download | classpath-fd01df1788740627e68faaa32bb26521095821c9.tar.gz | |
* gnu/java/net/protocol/http/HTTPURLConnection.java
(imports): Cleaned up.
(GetHTTPPropertiesAction): Removed, and moved contents to ...
(constructor): ... Here, using SystemProperties instead of System.
Diffstat (limited to 'gnu/java/net/protocol/http')
| -rw-r--r-- | gnu/java/net/protocol/http/HTTPURLConnection.java | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/gnu/java/net/protocol/http/HTTPURLConnection.java b/gnu/java/net/protocol/http/HTTPURLConnection.java index b28c3809d..3613486db 100644 --- a/gnu/java/net/protocol/http/HTTPURLConnection.java +++ b/gnu/java/net/protocol/http/HTTPURLConnection.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.java.net.protocol.http; +import gnu.classpath.SystemProperties; + import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; @@ -45,8 +47,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.ProtocolException; import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.security.cert.Certificate; import java.util.Collections; import java.util.Date; @@ -101,35 +101,23 @@ public class HTTPURLConnection { super(url); requestHeaders = new Headers(); - AccessController.doPrivileged(this.new GetHTTPPropertiesAction()); - } - - class GetHTTPPropertiesAction - implements PrivilegedAction - { - - public Object run() - { - proxyHostname = System.getProperty("http.proxyHost"); - if (proxyHostname != null && proxyHostname.length() > 0) - { - String port = System.getProperty("http.proxyPort"); - if (port != null && port.length() > 0) - { - proxyPort = Integer.parseInt(port); - } - else - { - proxyHostname = null; - proxyPort = -1; - } - } - agent = System.getProperty("http.agent"); - String ka = System.getProperty("http.keepAlive"); - keepAlive = !(ka != null && "false".equals(ka)); - return null; - } - + proxyHostname = SystemProperties.getProperty("http.proxyHost"); + if (proxyHostname != null && proxyHostname.length() > 0) + { + String port = SystemProperties.getProperty("http.proxyPort"); + if (port != null && port.length() > 0) + { + proxyPort = Integer.parseInt(port); + } + else + { + proxyHostname = null; + proxyPort = -1; + } + } + agent = SystemProperties.getProperty("http.agent"); + String ka = SystemProperties.getProperty("http.keepAlive"); + keepAlive = !(ka != null && "false".equals(ka)); } public void connect() |
