From: Michael Koch Date: Mon, 26 May 2003 12:58:02 +0000 (+0000) Subject: NetPermission.java, [...]: New versions from classpath. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b91c701d199af4c4860919595ccf2cc755418cc1;p=gcc.git NetPermission.java, [...]: New versions from classpath. 2003-05-26 Michael Koch * java/net/NetPermission.java, java/net/NetworkInterface.java, java/net/PasswordAuthentication.java, java/net/SocketPermission.java: New versions from classpath. From-SVN: r67174 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index be9100e20a5..77da3159ef5 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2003-05-26 Michael Koch + + * java/net/NetPermission.java, + java/net/NetworkInterface.java, + java/net/PasswordAuthentication.java, + java/net/SocketPermission.java: + New versions from classpath. + 2003-05-25 Michael Koch * java/io/PushbackInputStream.java, diff --git a/libjava/java/net/NetPermission.java b/libjava/java/net/NetPermission.java index 593b63504a8..6b796be7f04 100644 --- a/libjava/java/net/NetPermission.java +++ b/libjava/java/net/NetPermission.java @@ -41,9 +41,21 @@ import java.security.BasicPermission; /** * This class is used to model miscellaneous network permissions. It is - * a subclass of BasicPermission. This means that it models a "boolean" - * permission. One that you either have or do not have. Thus there is - * no permitted action list associated with this object. + * a subclass of BasicPermission. This means that it models a + * "boolean" permission. One that you either have or do not have. Thus + * there is no permitted action list associated with this object. + * + * The following permission names are defined for this class: + * + *
    + *
  • setDefaultAuthenticator - Grants the ability to install a facility + * to collect username and password information when requested by a + * web site or proxy server. + *
  • requestPasswordAuthentication - Grants the ability to ask the + * authentication facility for the user's password. + *
  • specifyStreamHandler - Grants the permission to specify the + * stream handler class used when loading from a URL. + *
* * @author Aaron M. Renn (arenn@urbanophile.com) */ diff --git a/libjava/java/net/NetworkInterface.java b/libjava/java/net/NetworkInterface.java index 4e8f4276c57..c3eb7108002 100644 --- a/libjava/java/net/NetworkInterface.java +++ b/libjava/java/net/NetworkInterface.java @@ -41,6 +41,12 @@ import java.util.Enumeration; import java.util.Vector; /** + * This class models a network interface on the host computer. A network + * interface contains a name (typically associated with a specific + * hardware adapter) and a list of addresses that are bound to it. + * For example, an ethernet interface may be named "eth0" and have the + * address 192.168.1.101 assigned to it. + * * @author Michael Koch * @since 1.4 */ @@ -61,7 +67,9 @@ public final class NetworkInterface throws SocketException; /** - * Returns the name of the network interface + * Returns the name of the network interface + * + * @return The name of the interface. */ public String getName () { @@ -73,8 +81,8 @@ public final class NetworkInterface * * If a @see SecurityManager is available all addresses are checked * with @see SecurityManager::checkConnect() if they are available. - * Only InetAddresses are returned where the security manager doesn't - * thrown an exception. + * Only InetAddresses are returned where the security manager + * doesn't throw an exception. * * @return An enumeration of all addresses. */ @@ -106,6 +114,8 @@ public final class NetworkInterface /** * Returns the display name of the interface + * + * @return The display name of the interface */ public String getDisplayName () { @@ -168,7 +178,7 @@ public final class NetworkInterface } /** - * Return an Enumeration of all available network interfaces + * Return an Enumeration of all available network interfaces * * @exception SocketException If an error occurs */ diff --git a/libjava/java/net/PasswordAuthentication.java b/libjava/java/net/PasswordAuthentication.java index 0c4faa54398..97554e3dde4 100644 --- a/libjava/java/net/PasswordAuthentication.java +++ b/libjava/java/net/PasswordAuthentication.java @@ -1,5 +1,5 @@ /* PasswordAuthentication.java -- Container class for username/password pairs - Copyright (C) 1998,2000 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,72 +45,64 @@ package java.net; */ public final class PasswordAuthentication { - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * The username - */ -private String username; - -/** - * The password - */ -private char[] password; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * Creates a new PasswordAuthentication object from the specified username - * and password. - * - * @param username The username for this object - * @param password The password for this object - */ -public -PasswordAuthentication(String username, char[] password) -{ - this.username = username; - this.password = password; -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * Returns the username associated with this object - * - * @return The username - */ -public String -getUserName() -{ - return(username); -} - -/*************************************************************************/ - -/** - * Returns the password associated with this object - * - * @return The password - */ -public char[] -getPassword() -{ - return(password); -} + /* + * Instance Variables + */ + + /** + * The username + */ + private String username; + + /** + * The password + */ + private char[] password; + + /*************************************************************************/ + + /* + * Constructors + */ + + /** + * Creates a new PasswordAuthentication object from the + * specified username and password. + * + * @param username The username for this object + * @param password The password for this object + */ + public PasswordAuthentication(String username, char[] password) + { + this.username = username; + this.password = password; + } + + /*************************************************************************/ + + /* + * Instance Methods + */ + + /** + * Returns the username associated with this object + * + * @return The username + */ + public String getUserName() + { + return(username); + } + + /** + * Returns the password associated with this object + * + * @return The password + */ + public char[] getPassword() + { + return(password); + } } // class PasswordAuthentication diff --git a/libjava/java/net/SocketPermission.java b/libjava/java/net/SocketPermission.java index 6fa65f8793a..dea04e2432a 100644 --- a/libjava/java/net/SocketPermission.java +++ b/libjava/java/net/SocketPermission.java @@ -96,6 +96,9 @@ import java.security.PermissionCollection; * Can accept connections from 197.197.20.1 *

* + * This class also supports IPv6 addresses. These should be specified + * in either RFC 2732 format or in full uncompressed form. + * * @since 1.2 * * @author Aaron M. Renn (arenn@urbanophile.com) @@ -159,7 +162,7 @@ public final class SocketPermission extends Permission /** * Returns a hash code value for this object. Overrides the - * Permission.hashCode() + * Permission.hashCode(). * * @return A hash code */ @@ -233,7 +236,7 @@ public final class SocketPermission extends Permission * Returns true if the permission object passed it is implied by the * this permission. This will be true if *

    - *
  • The argument is of type SocketPermission + *
  • The argument is of type SocketPermission *
  • The actions list of the argument are in this object's actions *
  • The port range of the argument is within this objects port range *
  • The hostname is equal to or a subset of this objects hostname @@ -247,7 +250,7 @@ public final class SocketPermission extends Permission * wildcards *
* - * @param perm The Permission to check against + * @param perm The Permission to check against * * @return true if the Permission is implied by * this object, false otherwise.