From 660188fb80a325b5ad000cac6359d99a4d2f9dd4 Mon Sep 17 00:00:00 2001 From: mkoch Date: Wed, 21 Aug 2002 05:34:45 +0000 Subject: 2003-08-21 Michael Koch * java/net/Authenticator.java: updated JDK 1.4 * java/net/ContentHandler.java: updated JDK 1.4 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56481 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/net/Authenticator.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'libjava/java/net/Authenticator.java') diff --git a/libjava/java/net/Authenticator.java b/libjava/java/net/Authenticator.java index 8dbf0f7c18c..f6ad9dd27b0 100644 --- a/libjava/java/net/Authenticator.java +++ b/libjava/java/net/Authenticator.java @@ -53,6 +53,7 @@ package java.net; * @since 1.2 * * @author Aaron M. Renn (arenn@urbanophile.com) + * @status Believed to be JDK 1.4 complete */ public abstract class Authenticator { @@ -74,6 +75,11 @@ private static Authenticator default_authenticator; * Instance Variables */ +/** + * The hostname of the site requesting authentication + */ +private String host; + /** * InternetAddress of the site requesting authentication */ @@ -156,6 +162,19 @@ setDefault(Authenticator def_auth) 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 @@ requestPasswordAuthentication(InetAddress addr, int port, String protocol, 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 @@ requestPasswordAuthentication(InetAddress addr, int port, String protocol, return(default_authenticator.getPasswordAuthentication()); } +/** + * @since 1.4 + */ +protected final String getRequestingHost() +{ + return(host); +} + /*************************************************************************/ /* -- cgit v1.2.3