OSDN Git Service

2005-04-29 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Apr 2005 06:26:55 +0000 (06:26 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Apr 2005 06:26:55 +0000 (06:26 +0000)
* gnu/java/net/protocol/http/HTTPConnection.java:
(userAgent): Initialize from system properties.
(initUserAgent): Removed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98977 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/gnu/java/net/protocol/http/HTTPConnection.java

index ba0e431..7a78f4d 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-29  Michael Koch  <konqueror@gmx.de>
+
+       * gnu/java/net/protocol/http/HTTPConnection.java:
+       (userAgent): Initialize from system properties.
+       (initUserAgent): Removed.
+
 2005-04-29  Mark Wielaard  <mark@klomp.org>
 
        * java/util/ResourceBundle.java (getObject): Clarify
index 20383be..779dbbd 100644 (file)
@@ -1,5 +1,5 @@
 /* HTTPConnection.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -39,6 +39,7 @@ exception statement from your version. */
 package gnu.java.net.protocol.http;
 
 import gnu.classpath.Configuration;
+import gnu.classpath.SystemProperties;
 import gnu.java.net.EmptyX509TrustManager;
 import gnu.java.net.protocol.http.event.ConnectionEvent;
 import gnu.java.net.protocol.http.event.ConnectionListener;
@@ -83,27 +84,7 @@ public class HTTPConnection
    */
   public static final int HTTPS_PORT = 443;
 
-  private static final String userAgent = initUserAgent();
-
-  private static String initUserAgent()
-  {
-    try
-      {
-        StringBuffer buf = new StringBuffer("libgcj");
-        buf.append(" (");
-        buf.append(System.getProperty("os.name"));
-        buf.append("; ");
-        buf.append(System.getProperty("os.arch"));
-        buf.append("; ");
-        buf.append(System.getProperty("user.language"));
-        buf.append(")");
-        return buf.toString();
-      }
-    catch (SecurityException e)
-      {
-        return "inetlib/1.1";
-      }
-  }
+  private static final String userAgent = SystemProperties.getProperty("http.agent");
 
   /**
    * The host name of the server to connect to.