Commit c7684ffe by Michael Koch Committed by Michael Koch

PushbackInputStream.java, [...]: Merged new versions from classpath.

2003-05-25  Michael Koch  <konqueror@gmx.de>

	* java/io/PushbackInputStream.java,
	java/net/Authenticator.java,
	java/net/ContentHandler.java,
	java/net/ContentHandlerFactory.java,
	java/net/DatagramSocket.java,
	java/net/DatagramSocketImpl.java,
	java/net/DatagramSocketImplFactory.java,
	java/net/FileNameMap.java,
	java/net/SocketImplFactory.java,
	java/net/SocketOptions.java,
	java/net/URLStreamHandlerFactory.java:
	Merged new versions from classpath.

From-SVN: r67165
parent eceea301
2003-05-25 Michael Koch <konqueror@gmx.de> 2003-05-25 Michael Koch <konqueror@gmx.de>
* java/io/PushbackInputStream.java,
java/net/Authenticator.java,
java/net/ContentHandler.java,
java/net/ContentHandlerFactory.java,
java/net/DatagramSocket.java,
java/net/DatagramSocketImpl.java,
java/net/DatagramSocketImplFactory.java,
java/net/FileNameMap.java,
java/net/SocketImplFactory.java,
java/net/SocketOptions.java,
java/net/URLStreamHandlerFactory.java:
Merged new versions from classpath.
2003-05-25 Michael Koch <konqueror@gmx.de>
* java/awt/Checkbox.java, * java/awt/Checkbox.java,
java/awt/Dialog.java, java/awt/Dialog.java,
java/awt/Font.java, java/awt/Font.java,
......
...@@ -74,8 +74,8 @@ public class PushbackInputStream extends FilterInputStream ...@@ -74,8 +74,8 @@ public class PushbackInputStream extends FilterInputStream
/** /**
* This method initializes a <code>PushbackInputStream</code> to * This method initializes a <code>PushbackInputStream</code> to
* read from the * specified subordinate <code>InputStream</code> * read from the specified subordinate <code>InputStream</code>
* with a default pushback buffer * size of 1. * with a default pushback buffer size of 1.
* *
* @param in The subordinate stream to read from * @param in The subordinate stream to read from
*/ */
...@@ -302,7 +302,7 @@ public class PushbackInputStream extends FilterInputStream ...@@ -302,7 +302,7 @@ public class PushbackInputStream extends FilterInputStream
* <code>skip</code> method on the underlying <code>InputStream</code> to * <code>skip</code> method on the underlying <code>InputStream</code> to
* skip additional bytes if necessary. * skip additional bytes if necessary.
* *
* @param num_bytes The requested number of bytes to skip * @param numBytes The requested number of bytes to skip
* *
* @return The actual number of bytes skipped. * @return The actual number of bytes skipped.
* *
......
/* Authenticator.java -- Abstract class for obtaining authentication info /* Authenticator.java -- Abstract class for obtaining authentication info
Copyright (C) 1998,2000 Free Software Foundation, Inc. Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -43,12 +43,13 @@ package java.net; ...@@ -43,12 +43,13 @@ package java.net;
* some network operations (such as hitting a password protected * some network operations (such as hitting a password protected
* web site). * web site).
* <p> * <p>
* To make use of this feature, a programmer must create a subclass of * To make use of this feature, a programmer must create a subclass
* Authenticator that knows how to obtain the necessary info. An example * that knows how to obtain the necessary info. An example
* would be a class that popped up a dialog box to prompt the user. * would be a class that popped up a dialog box to prompt the user.
* After creating an instance of that subclass, the static setDefault * After creating an instance of that subclass, the static
* method of this class is called to set up that instance as the object * <code>setDefault</code> method of this class is called to set up
* to use on subsequent calls to obtain authorization. * that instance as the object to use on subsequent calls to obtain
* authorization.
* *
* @since 1.2 * @since 1.2
* *
...@@ -57,86 +58,76 @@ package java.net; ...@@ -57,86 +58,76 @@ package java.net;
*/ */
public abstract class Authenticator public abstract class Authenticator
{ {
/*
/*************************************************************************/
/*
* Class Variables * Class Variables
*/ */
/** /**
* This is the default Authenticator object to use for password requests * This is the default Authenticator object to use for password requests
*/ */
private static Authenticator default_authenticator; private static Authenticator defaultAuthenticator;
/*************************************************************************/
/* /*
* Instance Variables * Instance Variables
*/ */
/** /**
* The hostname of the site requesting authentication * The hostname of the site requesting authentication
*/ */
private String host; private String host;
/** /**
* InternetAddress of the site requesting authentication * InternetAddress of the site requesting authentication
*/ */
private InetAddress addr; private InetAddress addr;
/** /**
* The port number of the site requesting authentication * The port number of the site requesting authentication
*/ */
private int port; private int port;
/** /**
* The protocol name of the site requesting authentication * The protocol name of the site requesting authentication
*/ */
private String protocol; private String protocol;
/** /**
* The prompt to display to the user when requesting authentication info * The prompt to display to the user when requesting authentication info
*/ */
private String prompt; private String prompt;
/** /**
* The authentication scheme in use * The authentication scheme in use
*/ */
private String scheme; private String scheme;
/*************************************************************************/ /*
/*
* Class Methods * Class Methods
*/ */
/** /**
* This method sets the default <code>Authenticator</code> object (an * This method sets the default <code>Authenticator</code> object (an
* instance of a * instance of a subclass of <code>Authenticator</code>) to use when
* subclass of <code>Authenticator</code>) to use when prompting the user for * prompting the user for
* information. Note that this method checks to see if the caller is * information. Note that this method checks to see if the caller is
* allowed to set this value (the "setDefaultAuthenticator" permission) * allowed to set this value (the "setDefaultAuthenticator" permission)
* and throws a <code>SecurityException</code> if it is not. * and throws a <code>SecurityException</code> if it is not.
* *
* @param def_auth The new default <code>Authenticator</code> object to use * @param defAuth The new default <code>Authenticator</code> object to use
* *
* @exception SecurityException If the caller does not have permission * @exception SecurityException If the caller does not have permission
* to perform this operation * to perform this operation
*/ */
public static void public static void setDefault(Authenticator defAuth)
setDefault(Authenticator def_auth) {
{
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
if (sm != null) if (sm != null)
sm.checkPermission(new NetPermission("setDefaultAuthenticator")); sm.checkPermission(new NetPermission("setDefaultAuthenticator"));
default_authenticator = def_auth; defaultAuthenticator = defAuth;
} }
/*************************************************************************/ /**
/**
* This method is called whenever a username and password for a given * This method is called whenever a username and password for a given
* network operation is required. First, a security check is made to see * network operation is required. First, a security check is made to see
* if the caller has the "requestPasswordAuthentication" * if the caller has the "requestPasswordAuthentication"
...@@ -159,16 +150,16 @@ setDefault(Authenticator def_auth) ...@@ -159,16 +150,16 @@ setDefault(Authenticator def_auth)
* @exception SecurityException If the caller does not have permission to * @exception SecurityException If the caller does not have permission to
* perform this operation * perform this operation
*/ */
public static PasswordAuthentication public static PasswordAuthentication
requestPasswordAuthentication(InetAddress addr, int port, String protocol, requestPasswordAuthentication(InetAddress addr, int port, String protocol,
String prompt, String scheme) String prompt, String scheme)
throws SecurityException throws SecurityException
{ {
return(requestPasswordAuthentication (null, addr, port, protocol, return(requestPasswordAuthentication (null, addr, port, protocol,
prompt, scheme)); prompt, scheme));
} }
/** /**
* This method is called whenever a username and password for a given * This method is called whenever a username and password for a given
* network operation is required. First, a security check is made to see * network operation is required. First, a security check is made to see
* if the caller has the "requestPasswordAuthentication" * if the caller has the "requestPasswordAuthentication"
...@@ -196,141 +187,123 @@ requestPasswordAuthentication(InetAddress addr, int port, String protocol, ...@@ -196,141 +187,123 @@ requestPasswordAuthentication(InetAddress addr, int port, String protocol,
* *
* @since 1.4 * @since 1.4
*/ */
public static PasswordAuthentication public static PasswordAuthentication
requestPasswordAuthentication(String host, InetAddress addr, int port, requestPasswordAuthentication(String host, InetAddress addr, int port,
String protocol, String prompt, String scheme) String protocol, String prompt, String scheme)
throws SecurityException throws SecurityException
{ {
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
if (sm != null) if (sm != null)
sm.checkPermission(new NetPermission("requestPasswordAuthentication")); sm.checkPermission(new NetPermission("requestPasswordAuthentication"));
if (default_authenticator == null) if (defaultAuthenticator == null)
return(null); return(null);
default_authenticator.host = host; defaultAuthenticator.host = host;
default_authenticator.addr = addr; defaultAuthenticator.addr = addr;
default_authenticator.port = port; defaultAuthenticator.port = port;
default_authenticator.protocol = protocol; defaultAuthenticator.protocol = protocol;
default_authenticator.prompt = prompt; defaultAuthenticator.prompt = prompt;
default_authenticator.scheme = scheme; defaultAuthenticator.scheme = scheme;
return(default_authenticator.getPasswordAuthentication());
}
/**
* Returns the hostname of the host or proxy requesting authorization,
* or null if not available.
*
* @since 1.4
*/
protected final String getRequestingHost()
{
return(host);
}
/*************************************************************************/ return(defaultAuthenticator.getPasswordAuthentication());
}
/* /*
* Constructors * Constructors
*/ */
/** /**
* Default, no-argument constructor for subclasses to call. * Default, no-argument constructor for subclasses to call.
*/ */
public public Authenticator()
Authenticator() {
{ }
}
/*************************************************************************/
/* /*
* Instance Methods * Instance Methods
*/ */
/** /**
* This method returns the address of the site that is requesting * This method returns the address of the site that is requesting
* authentication. * authentication.
* *
* @return The requesting site * @return The requesting site's address
*/ */
protected final InetAddress protected final InetAddress getRequestingSite()
getRequestingSite() {
{
return(addr); return(addr);
} }
/*************************************************************************/ /**
* Returns the hostname of the host or proxy requesting authorization,
* or <code>null</code> if not available.
*
* @return The name of the host requesting authentication, or
* </code>null</code> if it is not available.
*
* @since 1.4
*/
protected final String getRequestingHost()
{
return(host);
}
/** /**
* This method returns the port of the site that is requesting * This method returns the port of the site that is requesting
* authentication. * authentication.
* *
* @return The requesting port * @return The requesting port
*/ */
protected final int protected final int getRequestingPort()
getRequestingPort() {
{
return(port); return(port);
} }
/*************************************************************************/
/** /**
* This method returns the requesting protocol of the operation that is * This method returns the requesting protocol of the operation that is
* requesting authentication * requesting authentication
* *
* @return The requesting protocol * @return The requesting protocol
*/ */
protected final String protected final String getRequestingProtocol()
getRequestingProtocol() {
{
return(protocol); return(protocol);
} }
/*************************************************************************/ /**
/**
* Returns the prompt that should be used when requesting authentication * Returns the prompt that should be used when requesting authentication
* information from the user * information from the user
* *
* @return The user prompt * @return The user prompt
*/ */
protected final String protected final String getRequestingPrompt()
getRequestingPrompt() {
{
return(prompt); return(prompt);
} }
/*************************************************************************/ /**
/**
* This method returns the authentication scheme in use * This method returns the authentication scheme in use
* *
* @return The authentication scheme * @return The authentication scheme
*/ */
protected final String protected final String getRequestingScheme()
getRequestingScheme() {
{
return(scheme); return(scheme);
} }
/*************************************************************************/ /**
/**
* This method is called whenever a request for authentication is made. It * This method is called whenever a request for authentication is made. It
* can call the other getXXX methods to determine the information relevant * can call the other getXXX methods to determine the information relevant
* to this request. Subclasses should override this method, which returns * to this request. Subclasses should override this method, which returns
* <code>null</code> by default. * <code>null</code> by default.
* *
* @return The PasswordAuthentication information * @return The <code>PasswordAuthentication</code> information
*/ */
protected PasswordAuthentication protected PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication() {
{
return(null); return(null);
} }
} // class Authenticator } // class Authenticator
/* ContentHandler.java -- Abstract class for handling content from URL's /* ContentHandler.java -- Abstract class for handling content from URL's
Copyright (C) 1998, 1999 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -59,21 +59,22 @@ import java.io.IOException; ...@@ -59,21 +59,22 @@ import java.io.IOException;
*/ */
public abstract class ContentHandler public abstract class ContentHandler
{ {
/*
/*************************************************************************/
/*
* Constructors * Constructors
*/ */
/** /**
* Default, no-argument constructor. * Default, no-argument constructor.
*/ */
public ContentHandler() { } public ContentHandler()
{
}
/*************************************************************************/ /*
* Instance Methods
*/
/** /**
* This method reads from the <code>InputStream</code> of the passed in URL * This method reads from the <code>InputStream</code> of the passed in URL
* connection and uses the data downloaded to create an <code>Object</code> * connection and uses the data downloaded to create an <code>Object</code>
* represening the content. For example, if the URL is pointing to a GIF * represening the content. For example, if the URL is pointing to a GIF
...@@ -86,29 +87,32 @@ public ContentHandler() { } ...@@ -86,29 +87,32 @@ public ContentHandler() { }
* *
* @exception IOException If an error occurs * @exception IOException If an error occurs
*/ */
public abstract Object getContent(URLConnection urlc) throws IOException; public abstract Object getContent(URLConnection urlc)
throws IOException;
/*************************************************************************/ /**
/**
* This method reads from the <code>InputStream</code> of the passed in URL * This method reads from the <code>InputStream</code> of the passed in URL
* connection and uses the data downloaded to create an <code>Object</code> * connection and uses the data downloaded to create an <code>Object</code>
* represening the content. For example, if the URL is pointing to a GIF * represening the content. For example, if the URL is pointing to a GIF
* file, this method might return an <code>Image</code> object. This method * file, this method might return an <code>Image</code> object. This method
* must be implemented by subclasses. If the object doesnt match any type in * must be implemented by subclasses. This method uses the list of
* classes it returns null. * supplied classes as candidate types. If the data read doesn't match
* any of the supplied type, <code>null</code> is returned.
* *
* @param urlc A <code>URLConnection</code> object to read data from. * @param urlc A <code>URLConnection</code> object to read data from.
* @param classes An array of types of objects that are candidate types
* for the data to be read.
* *
* @return An object representing the data read * @return An object representing the data read, or <code>null</code>
* if the data does not match any of the candidate types.
* *
* @exception IOException If an error occurs * @exception IOException If an error occurs
* *
* @since 1.3 * @since 1.3
*/ */
public Object getContent(URLConnection urlc, Class[] classes) public Object getContent(URLConnection urlc, Class[] classes)
throws IOException throws IOException
{ {
Object obj = getContent (urlc); Object obj = getContent (urlc);
for (int i = 0; i < classes.length; i++) for (int i = 0; i < classes.length; i++)
...@@ -118,6 +122,6 @@ public Object getContent(URLConnection urlc, Class[] classes) ...@@ -118,6 +122,6 @@ public Object getContent(URLConnection urlc, Class[] classes)
} }
return null; return null;
} }
} // class ContentHandler } // class ContentHandler
/* ContentHandlerFactory.java -- Interface for creating content handlers /* ContentHandlerFactory.java -- Interface for creating content handlers
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -45,25 +45,24 @@ package java.net; ...@@ -45,25 +45,24 @@ package java.net;
*/ */
/** /**
* This interface maps MIME types to ContentHandler objects. It consists * This interface maps MIME types to <code>ContentHandler</code> objects.
* of one method that, when passed a MIME type, returns a handler for that * It consists of one method that, when passed a MIME type, returns a
* type. * handler for that type.
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
* @author Warren Levy <warrenl@cygnus.com> * @author Warren Levy <warrenl@cygnus.com>
*/ */
public interface ContentHandlerFactory public interface ContentHandlerFactory
{ {
/** /**
* This method is passed a MIME type as a string and is responsible for * This method is passed a MIME type as a string and is responsible for
* returning the appropriate ContentType object. * returning the appropriate <code>ContentHandler</code> object.
* *
* @param mime_type The MIME type to map to a ContentHandler * @param mimeType The MIME type to map to a <code>ContentHandler</code>
* *
* @return The ContentHandler for the passed in MIME type * @return The <code>ContentHandler</code> for the passed in MIME type
*/ */
ContentHandler public ContentHandler createContentHandler(String mimeType);
createContentHandler(String mime_type);
} // interface ContentHandlerFactory } // interface ContentHandlerFactory
/* DatagramSocket.java -- A class to model UDP sockets /* DatagramSocket.java -- A class to model UDP sockets
Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -94,9 +94,11 @@ public class DatagramSocket ...@@ -94,9 +94,11 @@ public class DatagramSocket
private boolean closed = false; private boolean closed = false;
/** /**
* Creates a DatagramSocket from a specified DatagramSocketImpl instance * Creates a <code>DatagramSocket</code> from a specified
* <code>DatagramSocketImpl</code> instance
* *
* @param impl The DatagramSocketImpl the socket will be created from * @param impl The <code>DatagramSocketImpl</code> the socket will be
* created from
* *
* @since 1.4 * @since 1.4
*/ */
...@@ -113,7 +115,7 @@ public class DatagramSocket ...@@ -113,7 +115,7 @@ public class DatagramSocket
* *
* @exception SocketException If an error occurs. * @exception SocketException If an error occurs.
* @exception SecurityException If a security manager exists and * @exception SecurityException If a security manager exists and
* its checkListen method doesn't allow the operation. * its <code>checkListen</code> method doesn't allow the operation.
*/ */
public DatagramSocket() throws SocketException public DatagramSocket() throws SocketException
{ {
...@@ -127,7 +129,7 @@ public class DatagramSocket ...@@ -127,7 +129,7 @@ public class DatagramSocket
* @param port The local port number to bind to. * @param port The local port number to bind to.
* *
* @exception SecurityException If a security manager exists and its * @exception SecurityException If a security manager exists and its
* checkListen method doesn't allow the operation. * <code>checkListen</code> method doesn't allow the operation.
* @exception SocketException If an error occurs. * @exception SocketException If an error occurs.
*/ */
public DatagramSocket(int port) throws SocketException public DatagramSocket(int port) throws SocketException
...@@ -190,7 +192,7 @@ public class DatagramSocket ...@@ -190,7 +192,7 @@ public class DatagramSocket
* @param laddr The local address to bind to. * @param laddr The local address to bind to.
* *
* @exception SecurityException If a security manager exists and its * @exception SecurityException If a security manager exists and its
* checkListen method doesn't allow the operation. * <code>checkListen</code> method doesn't allow the operation.
* @exception SocketException If an error occurs. * @exception SocketException If an error occurs.
* *
* @since 1.4 * @since 1.4
......
/* DatagramSocketImpl.java -- Abstract class for UDP socket implementations /* DatagramSocketImpl.java -- Abstract class for UDP socket implementations
Copyright (C) 1998, 1999 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 1998, 1999 2000, 2001,
2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -102,8 +103,8 @@ public abstract class DatagramSocketImpl implements SocketOptions ...@@ -102,8 +103,8 @@ public abstract class DatagramSocketImpl implements SocketOptions
* Takes a peek at the next packet received in order to retrieve the * Takes a peek at the next packet received in order to retrieve the
* address of the sender * address of the sender
* *
* @param i The InetAddress to fill in with the information about the * @param i The <code>InetAddress</code> to fill in with the information
* sender if the next packet * about the sender if the next packet
* *
* @return The port number of the sender of the packet * @return The port number of the sender of the packet
* *
...@@ -118,7 +119,7 @@ public abstract class DatagramSocketImpl implements SocketOptions ...@@ -118,7 +119,7 @@ public abstract class DatagramSocketImpl implements SocketOptions
* Takes a peek at the next packet received. This packet is not consumed. * Takes a peek at the next packet received. This packet is not consumed.
* With the next peekData/receive operation this packet will be read again. * With the next peekData/receive operation this packet will be read again.
* *
* @param p The DatagramPacket to fill in with the data sent. * @param p The <code>DatagramPacket</code> to fill in with the data sent.
* *
* @return The port number of the sender of the packet. * @return The port number of the sender of the packet.
* *
...@@ -147,7 +148,7 @@ public abstract class DatagramSocketImpl implements SocketOptions ...@@ -147,7 +148,7 @@ public abstract class DatagramSocketImpl implements SocketOptions
/** /**
* Receives a packet of data from the network Will block until a packet * Receives a packet of data from the network Will block until a packet
* arrives. The packet info in populated into the passed in * arrives. The packet info in populated into the passed in
* DatagramPacket object. * <code>DatagramPacket</code> object.
* *
* @param p A place to store the incoming packet. * @param p A place to store the incoming packet.
* *
...@@ -161,7 +162,7 @@ public abstract class DatagramSocketImpl implements SocketOptions ...@@ -161,7 +162,7 @@ public abstract class DatagramSocketImpl implements SocketOptions
/** /**
* Connects the socket to a host specified by address and port. * Connects the socket to a host specified by address and port.
* *
* @param address The InetAddress of the host to connect to * @param address The <code>InetAddress</code> of the host to connect to
* @param port The port number of the host to connect to * @param port The port number of the host to connect to
* *
* @exception SocketException If an error occurs * @exception SocketException If an error occurs
...@@ -288,26 +289,26 @@ public abstract class DatagramSocketImpl implements SocketOptions ...@@ -288,26 +289,26 @@ public abstract class DatagramSocketImpl implements SocketOptions
* Sets the specified option on a socket to the passed in object. For * Sets the specified option on a socket to the passed in object. For
* options that take an integer argument, the passed in object is an * options that take an integer argument, the passed in object is an
* <code>Integer</code>. For options that are set to on or off, the * <code>Integer</code>. For options that are set to on or off, the
* value passed will be a <code>Boolean</code>. The <code>option_id</code> * value passed will be a <code>Boolean</code>. The <code>optionId</code>
* parameter is one of the defined constants in the superinterface. * parameter is one of the defined constants in the superinterface.
* *
* @param option_id The identifier of the option * @param optionId The identifier of the option
* @param val The value to set the option to * @param val The value to set the option to
* *
* @exception SocketException If an error occurs * @exception SocketException If an error occurs
* @XXX This redeclaration from SocketOptions is a workaround to a gcj bug. * @XXX This redeclaration from SocketOptions is a workaround to a gcj bug.
*/ */
public abstract void setOption(int option_id, Object val) public abstract void setOption(int optionId, Object val)
throws SocketException; throws SocketException;
/** /**
* Returns the current setting of the specified option. The * Returns the current setting of the specified option. The
* <code>Object</code> returned will be an <code>Integer</code> for options * <code>Object</code> returned will be an <code>Integer</code> for options
* that have integer values. For options that are set to on or off, a * that have integer values. For options that are set to on or off, a
* <code>Boolean</code> will be returned. The <code>option_id</code> * <code>Boolean</code> will be returned. The <code>optionId</code>
* is one of the defined constants in the superinterface. * is one of the defined constants in the superinterface.
* *
* @param option_id The option identifier * @param optionId The option identifier
* *
* @return The current value of the option * @return The current value of the option
* *
......
/* DatagramSocketImplFactory.java /* DatagramSocketImplFactory.java
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -42,7 +42,8 @@ package java.net; ...@@ -42,7 +42,8 @@ package java.net;
*/ */
/** /**
* This interface defines one method which returns a DatagramSocketImpl object. * This interface defines one method which returns a
* <code>DatagramSocketImpl</code> object.
* This should not be needed by ordinary applications. * This should not be needed by ordinary applications.
* *
* @author Michael Koch <konqueror@gmx.de> * @author Michael Koch <konqueror@gmx.de>
...@@ -55,5 +56,5 @@ public interface DatagramSocketImplFactory ...@@ -55,5 +56,5 @@ public interface DatagramSocketImplFactory
* *
* @return A DatagramSocketImpl object * @return A DatagramSocketImpl object
*/ */
DatagramSocketImpl createDatagramSocketImpl(); public DatagramSocketImpl createDatagramSocketImpl();
} // interface DatagramSocketImplFactory } // interface DatagramSocketImplFactory
/* FileNameMap.java -- Maps filenames to MIME types /* FileNameMap.java -- Maps filenames to MIME types
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -54,7 +54,7 @@ package java.net; ...@@ -54,7 +54,7 @@ package java.net;
*/ */
public interface FileNameMap public interface FileNameMap
{ {
/** /**
* This method is passed a filename and is responsible for determining * This method is passed a filename and is responsible for determining
* the appropriate MIME type for that file. * the appropriate MIME type for that file.
* *
...@@ -62,8 +62,7 @@ public interface FileNameMap ...@@ -62,8 +62,7 @@ public interface FileNameMap
* *
* @return The MIME type for the filename passed in. * @return The MIME type for the filename passed in.
*/ */
String public String getContentTypeFor(String filename);
getContentTypeFor(String filename);
} // interface FileNameMap } // interface FileNameMap
/* SocketImplFactory.java -- Interface to create a SocketImpl object /* SocketImplFactory.java -- Interface to create a SocketImpl object
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -43,21 +43,20 @@ package java.net; ...@@ -43,21 +43,20 @@ package java.net;
*/ */
/** /**
* This interface defines one method which returns a SocketImpl object. * This interface defines one method which returns a <code>SocketImpl</code>
* This should not be needed by ordinary applications. * object. This should not be needed by ordinary applications.
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
* @author Per Bothner <bothner@cygnus.com> * @author Per Bothner <bothner@cygnus.com>
*/ */
public interface SocketImplFactory public interface SocketImplFactory
{ {
/** /**
* This method returns an instance of the SocketImpl object * This method returns an instance of the <code>SocketImpl</code> object
* *
* @return A SocketImpl object * @return A <code>SocketImpl</code> object
*/ */
SocketImpl public SocketImpl createSocketImpl();
createSocketImpl();
} // interface SocketImplFactory } // interface SocketImplFactory
/* SocketOptions.java -- Implements options for sockets (duh!) /* SocketOptions.java -- Implements options for sockets (duh!)
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001,
2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -138,30 +139,30 @@ public interface SocketOptions ...@@ -138,30 +139,30 @@ public interface SocketOptions
* Sets the specified option on a socket to the passed in object. For * Sets the specified option on a socket to the passed in object. For
* options that take an integer argument, the passed in object is an * options that take an integer argument, the passed in object is an
* <code>Integer</code>. For options that are set to on or off, the * <code>Integer</code>. For options that are set to on or off, the
* value passed will be a <code>Boolean</code>. The <code>option_id</code> * value passed will be a <code>Boolean</code>. The <code>optionId</code>
* parameter is one of the defined constants in this interface. * parameter is one of the defined constants in this interface.
* *
* @param option_id The identifier of the option * @param optionId The identifier of the option
* @param val The value to set the option to * @param val The value to set the option to
* *
* @exception SocketException If an error occurs * @exception SocketException If an error occurs
*/ */
void setOption(int option_id, Object val) throws SocketException; void setOption(int optionId, Object val) throws SocketException;
/** /**
* Returns the current setting of the specified option. The * Returns the current setting of the specified option. The
* <code>Object</code> returned will be an <code>Integer</code> for options * <code>Object</code> returned will be an <code>Integer</code> for options
* that have integer values. For options that are set to on or off, a * that have integer values. For options that are set to on or off, a
* <code>Boolean</code> will be returned. The <code>option_id</code> * <code>Boolean</code> will be returned. The <code>optionId</code>
* is one of the defined constants in this interface. * parameter is one of the defined constants in this interface.
* *
* @param option_id The option identifier * @param optionId The option identifier
* *
* @return The current value of the option * @return The current value of the option
* *
* @exception SocketException If an error occurs * @exception SocketException If an error occurs
*/ */
Object getOption(int option_id) throws SocketException; Object getOption(int optionId) throws SocketException;
} // interface SocketOptions } // interface SocketOptions
/* URLStreamHandlerFactory.java -- Maps protocols to URLStreamHandlers /* URLStreamHandlerFactory.java -- Maps protocols to URLStreamHandlers
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -46,23 +46,22 @@ package java.net; ...@@ -46,23 +46,22 @@ package java.net;
/** /**
* This interface contains one method which maps the protocol portion of * This interface contains one method which maps the protocol portion of
* a URL (eg, "http" in "http://www.urbanophile.com/arenn/") to a * a URL (eg, "http" in "http://www.urbanophile.com/arenn/") to a
* URLStreamHandler object. * <code>URLStreamHandler</code> object.
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
* @author Warren Levy <warrenl@cygnus.com> * @author Warren Levy <warrenl@cygnus.com>
*/ */
public interface URLStreamHandlerFactory public interface URLStreamHandlerFactory
{ {
/** /**
* This method maps the protocol portion of a URL to a URLStreamHandler * This method maps the protocol portion of a URL to a
* object. * <code>URLStreamHandler</code> object.
* *
* @param protocol The protocol name to map ("http", "ftp", etc). * @param protocol The protocol name to map ("http", "ftp", etc).
* *
* @return The URLStreamHandler for the specified protocol * @return The <code>URLStreamHandler</code> for the specified protocol
*/ */
URLStreamHandler public URLStreamHandler createURLStreamHandler(String protocol);
createURLStreamHandler(String protocol);
} // interface URLStreamHandlerFactory } // interface URLStreamHandlerFactory
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment