This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

java.net.Authenticator


Hello list,


I have extended java.net.Authenticator to be JDK 1.4 compatible. Please review and send commits.

If it gets accepted it needs to get commited to classpath cvs too.


Greetings,
Michael


P.S.: I have fill the form to get cvs access, I should have it soon. I can commit the changes to 
gcc cvs myself.

Index: java/net/Authenticator.java
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/java/net/Authenticator.java,v
retrieving revision 1.3
diff -u -b -r1.3 Authenticator.java
--- java/net/Authenticator.java	27 Jul 2002 00:53:42 -0000	1.3
+++ java/net/Authenticator.java	20 Aug 2002 07:43:08 -0000
@@ -75,6 +75,11 @@
  */
 
 /**
+  * The hostname of the site requesting authentication
+  */
+private String host;
+
+/**
   * InternetAddress of the site requesting authentication
   */
 private InetAddress addr;
@@ -156,6 +161,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 +182,7 @@
   if (default_authenticator == null)
     return(null);
 
+  default_authenticator.host = host;
   default_authenticator.addr = addr;
   default_authenticator.port = port;
   default_authenticator.protocol = protocol;
@@ -171,6 +190,14 @@
   default_authenticator.scheme = scheme;
 
   return(default_authenticator.getPasswordAuthentication());
+}
+
+/**
+ *  @since 1.4
+ */
+protected final String getRequestingHost()
+{
+  return(host);
 }
 
 /*************************************************************************/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]