1 |
/* HTTPConnection.java -- |
/* HTTPConnection.java -- |
2 |
Copyright (C) 2004 Free Software Foundation, Inc. |
Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
39 |
package gnu.java.net.protocol.http; |
package gnu.java.net.protocol.http; |
40 |
|
|
41 |
import gnu.classpath.Configuration; |
import gnu.classpath.Configuration; |
42 |
|
import gnu.classpath.SystemProperties; |
43 |
import gnu.java.net.EmptyX509TrustManager; |
import gnu.java.net.EmptyX509TrustManager; |
44 |
import gnu.java.net.protocol.http.event.ConnectionEvent; |
import gnu.java.net.protocol.http.event.ConnectionEvent; |
45 |
import gnu.java.net.protocol.http.event.ConnectionListener; |
import gnu.java.net.protocol.http.event.ConnectionListener; |
84 |
*/ |
*/ |
85 |
public static final int HTTPS_PORT = 443; |
public static final int HTTPS_PORT = 443; |
86 |
|
|
87 |
private static final String userAgent = initUserAgent(); |
private static final String userAgent = SystemProperties.getProperty("http.agent"); |
|
|
|
|
private static String initUserAgent() |
|
|
{ |
|
|
try |
|
|
{ |
|
|
StringBuffer buf = new StringBuffer("classpath/"); |
|
|
buf.append(Configuration.CLASSPATH_VERSION); |
|
|
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"; |
|
|
} |
|
|
} |
|
88 |
|
|
89 |
/** |
/** |
90 |
* The host name of the server to connect to. |
* The host name of the server to connect to. |