This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
java.net.Authenticator
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 23 Aug 2002 07:36:58 +0200
- Subject: java.net.Authenticator
Hello list.
Another patch for review. This code can go into classpath too.
Michael
--- /home/mkoch/src/classpath/java/net/Authenticator.java 2002-07-28 16:35:52.000000000 +0200
+++ java/net/Authenticator.java 2002-08-20 11:16:11.000000000 +0200
@@ -53,6 +53,7 @@
* @since 1.2
*
* @author Aaron M. Renn (arenn@urbanophile.com)
+ * @status Believed to be JDK 1.4 complete
*/
public abstract class Authenticator
{
@@ -75,6 +76,11 @@
*/
/**
+ * The hostname of the site requesting authentication
+ */
+private String host;
+
+/**
* InternetAddress of the site requesting authentication
*/
private InetAddress addr;
@@ -156,6 +162,19 @@
public static PasswordAuthentication
requestPasswordAuthentication(InetAddress addr, int port, String protocol,
String prompt, String scheme)
+ throws SecurityException
+{
+ return(requestPasswordAuthentication (null, addr, port, protocol,
+ prompt, scheme));
+}
+
+/**
+ * @since 1.4
+ */
+public static PasswordAuthentication
+requestPasswordAuthentication(String host, InetAddress addr, int port,
+ String protocol, String prompt, String scheme)
+ throws SecurityException
{
SecurityManager sm = System.getSecurityManager();
if (sm != null)
@@ -164,6 +183,7 @@
if (default_authenticator == null)
return(null);
+ default_authenticator.host = host;
default_authenticator.addr = addr;
default_authenticator.port = port;
default_authenticator.protocol = protocol;
@@ -173,6 +193,14 @@
return(default_authenticator.getPasswordAuthentication());
}
+/**
+ * @since 1.4
+ */
+protected final String getRequestingHost()
+{
+ return(host);
+}
+
/*************************************************************************/
/*