|
From: <ls...@us...> - 2009-03-14 10:45:25
|
Revision: 5101
http://jnode.svn.sourceforge.net/jnode/?rev=5101&view=rev
Author: lsantha
Date: 2009-03-14 10:45:16 +0000 (Sat, 14 Mar 2009)
Log Message:
-----------
OpenJDK integration.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/vm/VmSystem.java
Added Paths:
-----------
trunk/core/src/openjdk/java/java/net/AbstractPlainDatagramSocketImpl.java
trunk/core/src/openjdk/java/java/net/AbstractPlainSocketImpl.java
trunk/core/src/openjdk/java/java/net/Authenticator.java
trunk/core/src/openjdk/java/java/net/ContentHandler.java
trunk/core/src/openjdk/java/java/net/DatagramPacket.java
trunk/core/src/openjdk/java/java/net/DatagramSocketImpl.java
trunk/core/src/openjdk/java/java/net/HttpURLConnection.java
trunk/core/src/openjdk/java/java/net/JarURLConnection.java
trunk/core/src/openjdk/java/java/net/NetPermission.java
trunk/core/src/openjdk/java/java/net/PasswordAuthentication.java
trunk/core/src/openjdk/java/java/net/Proxy.java
trunk/core/src/openjdk/java/java/net/ProxySelector.java
trunk/core/src/openjdk/java/java/net/SocketAddress.java
trunk/core/src/openjdk/java/java/net/SocketImpl.java
trunk/core/src/openjdk/java/java/net/SocksConsts.java
trunk/core/src/openjdk/java/java/net/URLConnection.java
trunk/core/src/openjdk/vm/java/net/
trunk/core/src/openjdk/vm/java/net/NativeDatagramPacket.java
Removed Paths:
-------------
trunk/core/src/classpath/java/java/net/Authenticator.java
trunk/core/src/classpath/java/java/net/ContentHandler.java
trunk/core/src/classpath/java/java/net/DatagramPacket.java
trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java
trunk/core/src/classpath/java/java/net/HttpURLConnection.java
trunk/core/src/classpath/java/java/net/JarURLConnection.java
trunk/core/src/classpath/java/java/net/NetPermission.java
trunk/core/src/classpath/java/java/net/PasswordAuthentication.java
trunk/core/src/classpath/java/java/net/Proxy.java
trunk/core/src/classpath/java/java/net/ProxySelector.java
trunk/core/src/classpath/java/java/net/ResolverCache.java
trunk/core/src/classpath/java/java/net/SocketAddress.java
trunk/core/src/classpath/java/java/net/SocketImpl.java
trunk/core/src/classpath/java/java/net/URLConnection.java
Deleted: trunk/core/src/classpath/java/java/net/Authenticator.java
===================================================================
--- trunk/core/src/classpath/java/java/net/Authenticator.java 2009-03-13 20:43:06 UTC (rev 5100)
+++ trunk/core/src/classpath/java/java/net/Authenticator.java 2009-03-14 10:45:16 UTC (rev 5101)
@@ -1,313 +0,0 @@
-/* Authenticator.java -- Abstract class for obtaining authentication info
- Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.net;
-
-
-/**
- * This abstract class provides a model for obtaining authentication
- * information (in the form of a username and password) required by
- * some network operations (such as hitting a password protected
- * web site).
- * <p>
- * To make use of this feature, a programmer must create a subclass
- * that knows how to obtain the necessary info. An example
- * would be a class that popped up a dialog box to prompt the user.
- * After creating an instance of that subclass, the static
- * <code>setDefault</code> method of this class is called to set up
- * that instance as the object to use on subsequent calls to obtain
- * authorization.
- *
- * @since 1.2
- *
- * @author Aaron M. Renn (ar...@ur...)
- * @status Believed to be JDK 1.4 complete
- */
-public abstract class Authenticator
-{
- /*
- * Class Variables
- */
-
- /**
- * This is the default Authenticator object to use for password requests
- */
- private static Authenticator defaultAuthenticator;
-
- /*
- * Instance Variables
- */
-
- /**
- * The hostname of the site requesting authentication
- */
- private String host;
-
- /**
- * InternetAddress of the site requesting authentication
- */
- private InetAddress addr;
-
- /**
- * The port number of the site requesting authentication
- */
- private int port;
-
- /**
- * The protocol name of the site requesting authentication
- */
- private String protocol;
-
- /**
- * The prompt to display to the user when requesting authentication info
- */
- private String prompt;
-
- /**
- * The authentication scheme in use
- */
- private String scheme;
-
- /*
- * Class Methods
- */
-
- /**
- * This method sets the default <code>Authenticator</code> object (an
- * instance of a subclass of <code>Authenticator</code>) to use when
- * prompting the user for
- * information. Note that this method checks to see if the caller is
- * allowed to set this value (the "setDefaultAuthenticator" permission)
- * and throws a <code>SecurityException</code> if it is not.
- *
- * @param defAuth The new default <code>Authenticator</code> object to use
- *
- * @exception SecurityException If the caller does not have permission
- * to perform this operation
- */
- public static void setDefault(Authenticator defAuth)
- {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new NetPermission("setDefaultAuthenticator"));
-
- defaultAuthenticator = defAuth;
- }
-
- /**
- * This method is called whenever a username and password for a given
- * network operation is required. First, a security check is made to see
- * if the caller has the "requestPasswordAuthentication"
- * permission. If not, the method thows an exception. If there is no
- * default <code>Authenticator</code> object, the method then returns
- * <code>null</code>. Otherwise, the default authenticators's instance
- * variables are initialized and it's <code>getPasswordAuthentication</code>
- * method is called to get the actual authentication information to return.
- *
- * @param addr The address requesting authentication
- * @param port The port requesting authentication
- * @param protocol The protocol requesting authentication
- * @param prompt The prompt to display to the user when requesting
- * authentication info
- * @param scheme The authentication scheme in use
- *
- * @return A <code>PasswordAuthentication</code> object with the user's
- * authentication info.
- *
- * @exception SecurityException If the caller does not have permission to
- * perform this operation
- */
- public static PasswordAuthentication requestPasswordAuthentication(InetAddress addr,
- int port,
- String protocol,
- String prompt,
- String scheme)
- throws SecurityException
- {
- return requestPasswordAuthentication(null, addr, port, protocol, prompt,
- scheme);
- }
-
- /**
- * This method is called whenever a username and password for a given
- * network operation is required. First, a security check is made to see
- * if the caller has the "requestPasswordAuthentication"
- * permission. If not, the method thows an exception. If there is no
- * default <code>Authenticator</code> object, the method then returns
- * <code>null</code>. Otherwise, the default authenticators's instance
- * variables are initialized and it's <code>getPasswordAuthentication</code>
- * method is called to get the actual authentication information to return.
- * This method is the preferred one as it can be used with hostname
- * when addr is unknown.
- *
- * @param host The hostname requesting authentication
- * @param addr The address requesting authentication
- * @param port The port requesting authentication
- * @param protocol The protocol requesting authentication
- * @param prompt The prompt to display to the user when requesting
- * authentication info
- * @param scheme The authentication scheme in use
- *
- * @return A <code>PasswordAuthentication</code> object with the user's
- * authentication info.
- *
- * @exception SecurityException If the caller does not have permission to
- * perform this operation
- *
- * @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)
- sm.checkPermission(new NetPermission("requestPasswordAuthentication"));
-
- if (defaultAuthenticator == null)
- return null;
-
- defaultAuthenticator.host = host;
- defaultAuthenticator.addr = addr;
- defaultAuthenticator.port = port;
- defaultAuthenticator.protocol = protocol;
- defaultAuthenticator.prompt = prompt;
- defaultAuthenticator.scheme = scheme;
-
- return defaultAuthenticator.getPasswordAuthentication();
- }
-
- /*
- * Constructors
- */
-
- /**
- * Default, no-argument constructor for subclasses to call.
- */
- public Authenticator()
- {
- }
-
- /*
- * Instance Methods
- */
-
- /**
- * This method returns the address of the site that is requesting
- * authentication.
- *
- * @return The requesting site's address
- */
- protected final InetAddress getRequestingSite()
- {
- 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
- * authentication.
- *
- * @return The requesting port
- */
- protected final int getRequestingPort()
- {
- return port;
- }
-
- /**
- * This method returns the requesting protocol of the operation that is
- * requesting authentication
- *
- * @return The requesting protocol
- */
- protected final String getRequestingProtocol()
- {
- return protocol;
- }
-
- /**
- * Returns the prompt that should be used when requesting authentication
- * information from the user
- *
- * @return The user prompt
- */
- protected final String getRequestingPrompt()
- {
- return prompt;
- }
-
- /**
- * This method returns the authentication scheme in use
- *
- * @return The authentication scheme
- */
- protected final String getRequestingScheme()
- {
- return scheme;
- }
-
- /**
- * This method is called whenever a request for authentication is made. It
- * can call the other getXXX methods to determine the information relevant
- * to this request. Subclasses should override this method, which returns
- * <code>null</code> by default.
- *
- * @return The <code>PasswordAuthentication</code> information
- */
- protected PasswordAuthentication getPasswordAuthentication()
- {
- return null;
- }
-} // class Authenticator
Deleted: trunk/core/src/classpath/java/java/net/ContentHandler.java
===================================================================
--- trunk/core/src/classpath/java/java/net/ContentHandler.java 2009-03-13 20:43:06 UTC (rev 5100)
+++ trunk/core/src/classpath/java/java/net/ContentHandler.java 2009-03-14 10:45:16 UTC (rev 5101)
@@ -1,126 +0,0 @@
-/* ContentHandler.java -- Abstract class for handling content from URL's
- Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.net;
-
-import java.io.IOException;
-
-/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This is an abstract class that is the superclass for classes that read
- * objects from URL's. Calling the <code>getContent()</code> method in the
- * <code>URL</code> class or the <code>URLConnection</code> class will cause
- * an instance of a subclass of <code>ContentHandler</code> to be created for
- * the MIME type of the object being downloaded from the URL. Thus, this
- * class is seldom needed by applications/applets directly, but only
- * indirectly through methods in other classes.
- *
- * @author Aaron M. Renn (ar...@ur...)
- * @author Warren Levy (wa...@cy...)
- */
-public abstract class ContentHandler
-{
- /*
- * Constructors
- */
-
- /**
- * Default, no-argument constructor.
- */
- public ContentHandler()
- {
- }
-
- /*
- * Instance Methods
- */
-
- /**
- * 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>
- * 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
- * must be implemented by subclasses.
- *
- * @param urlc A <code>URLConnection</code> object to read data from.
- *
- * @return An object representing the data read
- *
- * @exception IOException If an error occurs
- */
- public abstract Object getContent(URLConnection urlc)
- throws IOException;
-
- /**
- * 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>
- * 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
- * must be implemented by subclasses. This method uses the list of
- * 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 classes An array of types of objects that are candidate types
- * for the data to be 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
- *
- * @since 1.3
- */
- public Object getContent(URLConnection urlc, Class[] classes)
- throws IOException
- {
- Object obj = getContent(urlc);
-
- for (int i = 0; i < classes.length; i++)
- {
- if (classes[i].isInstance(obj))
- return obj;
- }
-
- return null;
- }
-} // class ContentHandler
Deleted: trunk/core/src/classpath/java/java/net/DatagramPacket.java
===================================================================
--- trunk/core/src/classpath/java/java/net/DatagramPacket.java 2009-03-13 20:43:06 UTC (rev 5100)
+++ trunk/core/src/classpath/java/java/net/DatagramPacket.java 2009-03-14 10:45:16 UTC (rev 5101)
@@ -1,391 +0,0 @@
-/* DatagramPacket.java -- Class to model a packet to be sent via UDP
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.net;
-
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This class models a packet of data that is to be sent across the network
- * using a connectionless protocol such as UDP. It contains the data
- * to be send, as well as the destination address and port. Note that
- * datagram packets can arrive in any order and are not guaranteed to be
- * delivered at all.
- * <p>
- * This class can also be used for receiving data from the network.
- * <p>
- * Note that for all method below where the buffer length passed by the
- * caller cannot exceed the actually length of the byte array passed as
- * the buffer, if this condition is not true, then the method silently
- * reduces the length value to maximum allowable value.
- *
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- *
- * @author Warren Levy (wa...@cy...)
- * @author Aarom M. Renn (ar...@ur...) (Documentation comments)
- * @date April 28, 1999.
- */
-public final class DatagramPacket
-{
- /**
- * The data buffer to send
- */
- private byte[] buffer;
-
- /**
- * This is the offset into the buffer to start sending from or receiving to.
- */
- private int offset;
-
- /**
- * The length of the data buffer to send.
- */
- int length;
-
- /**
- * The maximal length of the buffer.
- */
- int maxlen;
-
- /**
- * The address to which the packet should be sent or from which it
- * was received.
- */
- private InetAddress address;
-
- /**
- * The port to which the packet should be sent or from which it was
- * was received.
- */
- private int port;
-
- /**
- * This method initializes a new instance of <code>DatagramPacket</code>
- * which has the specified buffer, offset, and length.
- *
- * @param buf The buffer for holding the incoming datagram.
- * @param offset The offset into the buffer to start writing.
- * @param length The maximum number of bytes to read.
- *
- * @since 1.2
- */
- public DatagramPacket(byte[] buf, int offset, int length)
- {
- setData(buf, offset, length);
- address = null;
- port = -1;
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * receiving packets from the network.
- *
- * @param buf A buffer for storing the returned packet data
- * @param length The length of the buffer (must be <= buf.length)
- */
- public DatagramPacket(byte[] buf, int length)
- {
- this(buf, 0, length);
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param offset The offset into the buffer to start writing from.
- * @param length The length of the buffer (must be <= buf.length)
- * @param address The address to send to
- * @param port The port to send to
- *
- * @since 1.2
- */
- public DatagramPacket(byte[] buf, int offset, int length,
- InetAddress address, int port)
- {
- setData(buf, offset, length);
- setAddress(address);
- setPort(port);
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param length The length of the buffer (must be <= buf.length)
- * @param address The address to send to
- * @param port The port to send to
- */
- public DatagramPacket(byte[] buf, int length, InetAddress address, int port)
- {
- this(buf, 0, length, address, port);
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param offset The offset into the buffer to start writing from.
- * @param length The length of the buffer (must be <= buf.length)
- * @param address The socket address to send to
- *
- * @exception SocketException If an error occurs
- * @exception IllegalArgumentException If address type is not supported
- *
- * @since 1.4
- */
- public DatagramPacket(byte[] buf, int offset, int length,
- SocketAddress address) throws SocketException
- {
- if (! (address instanceof InetSocketAddress))
- throw new IllegalArgumentException("unsupported address type");
-
- InetSocketAddress tmp = (InetSocketAddress) address;
- setData(buf, offset, length);
- setAddress(tmp.getAddress());
- setPort(tmp.getPort());
- }
-
- /**
- * Initializes a new instance of <code>DatagramPacket</code> for
- * transmitting packets across the network.
- *
- * @param buf A buffer containing the data to send
- * @param length The length of the buffer (must be <= buf.length)
- * @param address The socket address to send to
- *
- * @exception SocketException If an error occurs
- * @exception IllegalArgumentException If address type is not supported
- *
- * @since 1.4
- */
- public DatagramPacket(byte[] buf, int length, SocketAddress address)
- throws SocketException
- {
- this(buf, 0, length, address);
- }
-
- /**
- * Returns the address that this packet is being sent to or, if it was used
- * to receive a packet, the address that is was received from. If the
- * constructor that doesn not take an address was used to create this object
- * and no packet was actually read into this object, then this method
- * returns <code>null</code>.
- *
- * @return The address for this packet.
- */
- public synchronized InetAddress getAddress()
- {
- return address;
- }
-
- /**
- * Returns the port number this packet is being sent to or, if it was used
- * to receive a packet, the port that it was received from. If the
- * constructor that doesn not take an address was used to create this object
- * and no packet was actually read into this object, then this method
- * will return 0.
- *
- * @return The port number for this packet
- */
- public synchronized int getPort()
- {
- return port;
- }
-
- /**
- * Returns the data buffer for this packet
- *
- * @return This packet's data buffer
- */
- public synchronized byte[] getData()
- {
- return buffer;
- }
-
- /**
- * This method returns the current offset value into the data buffer
- * where data will be sent from.
- *
- * @return The buffer offset.
- *
- * @since 1.2
- */
- public synchronized int getOffset()
- {
- return offset;
- }
-
- /**
- * Returns the length of the data in the buffer
- *
- * @return The length of the data
- */
- public synchronized int getLength()
- {
- return length;
- }
-
- /**
- * This sets the address to which the data packet will be transmitted.
- *
- * @param address The destination address
- *
- * @since 1.1
- */
- public synchronized void setAddress(InetAddress address)
- {
- this.address = address;
- }
-
- /**
- * This sets the port to which the data packet will be transmitted.
- *
- * @param port The destination port
- *
- * @since 1.1
- */
- public synchronized void setPort(int port)
- {
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Invalid port: " + port);
-
- this.port = port;
- }
-
- /**
- * Sets the address of the remote host this package will be sent
- *
- * @param address The socket address of the remove host
- *
- * @exception IllegalArgumentException If address type is not supported
- *
- * @since 1.4
- */
- public void setSocketAddress(SocketAddress address)
- throws IllegalArgumentException
- {
- if (address == null)
- throw new IllegalArgumentException("address may not be null");
-
- InetSocketAddress tmp = (InetSocketAddress) address;
- this.address = tmp.getAddress();
- this.port = tmp.getPort();
- }
-
- /**
- * Gets the socket address of the host this packet
- * will be sent to/is coming from
- *
- * @return The socket address of the remote host
- *
- * @since 1.4
- */
- public SocketAddress getSocketAddress()
- {
- return new InetSocketAddress(address, port);
- }
-
- /**
- * Sets the data buffer for this packet.
- *
- * @param buf The new buffer for this packet
- *
- * @exception NullPointerException If the argument is null
- *
- * @since 1.1
- */
- public void setData(byte[] buf)
- {
- setData(buf, 0, buf.length);
- }
-
- /**
- * This method sets the data buffer for the packet.
- *
- * @param buf The byte array containing the data for this packet.
- * @param offset The offset into the buffer to start reading data from.
- * @param length The number of bytes of data in the buffer.
- *
- * @exception NullPointerException If the argument is null
- *
- * @since 1.2
- */
- public synchronized void setData(byte[] buf, int offset, int length)
- {
- // This form of setData must be used if offset is to be changed.
- if (buf == null)
- throw new NullPointerException("Null buffer");
- if (offset < 0)
- throw new IllegalArgumentException("Invalid offset: " + offset);
-
- buffer = buf;
- this.offset = offset;
- setLength(length);
- }
-
- /**
- * Sets the length of the data in the buffer.
- *
- * @param length The new length. (Where len <= buf.length)
- *
- * @exception IllegalArgumentException If the length is negative or
- * if the length is greater than the packet's data buffer length
- *
- * @since 1.1
- */
- public synchronized void setLength(int length)
- {
- if (length < 0)
- throw new IllegalArgumentException("Invalid length: " + length);
- if (offset + length > buffer.length)
- throw new IllegalArgumentException("Potential buffer overflow - offset: "
- + offset + " length: " + length);
-
- this.length = length;
- this.maxlen = length;
- }
-}
Deleted: trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java
===================================================================
--- trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java 2009-03-13 20:43:06 UTC (rev 5100)
+++ trunk/core/src/classpath/java/java/net/DatagramSocketImpl.java 2009-03-14 10:45:16 UTC (rev 5101)
@@ -1,296 +0,0 @@
-/* DatagramSocketImpl.java -- Abstract class for UDP socket implementations
- Copyright (C) 1998, 1999 2000, 2001,
- 2002, 2003 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.net;
-
-import java.io.FileDescriptor;
-import java.io.IOException;
-
-
-/**
- * This abstract class models a datagram socket implementation. An
- * actual implementation class would implement these methods, probably
- * via redirecting them to native code.
- * <p>
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * <p>
- * Status: Believed complete and correct.
- *
- * @author Aaron M. Renn (ar...@ur...)
- * @author Warren Levy (wa...@cy...)
- * @since 1.1
- */
-public abstract class DatagramSocketImpl implements SocketOptions
-{
- /**
- * The local port to which this socket is bound
- */
- protected int localPort;
-
- /**
- * The FileDescriptor object for this object.
- */
- protected FileDescriptor fd;
-
- /**
- * Default, no-argument constructor for subclasses to call.
- */
- public DatagramSocketImpl()
- {
- }
-
- /**
- * This method binds the socket to the specified local port and address.
- *
- * @param lport The port number to bind to
- * @param laddr The address to bind to
- *
- * @exception SocketException If an error occurs
- */
- protected abstract void bind(int lport, InetAddress laddr)
- throws SocketException;
-
- /**
- * This methods closes the socket
- */
- protected abstract void close();
-
- /**
- * Creates a new datagram socket.
- *
- * @exception SocketException If an error occurs
- */
- protected abstract void create() throws SocketException;
-
- /**
- * Takes a peek at the next packet received in order to retrieve the
- * address of the sender
- *
- * @param i The <code>InetAddress</code> to fill in with the information
- * about the sender if the next packet
- *
- * @return The port number of the sender of the packet
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- */
- protected abstract int peek(InetAddress i) throws IOException;
-
- /**
- * 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.
- *
- * @param p The <code>DatagramPacket</code> to fill in with the data sent.
- *
- * @return The port number of the sender of the packet.
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- *
- * @since 1.4
- */
- protected abstract int peekData(DatagramPacket p) throws IOException;
-
- /**
- * Transmits the specified packet of data to the network. The destination
- * host and port should be encoded in the packet.
- *
- * @param p The packet to send
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- */
- protected abstract void send(DatagramPacket p) throws IOException;
-
- /**
- * Receives a packet of data from the network Will block until a packet
- * arrives. The packet info in populated into the passed in
- * <code>DatagramPacket</code> object.
- *
- * @param p A place to store the incoming packet.
- *
- * @exception IOException If an error occurs
- * @exception PortUnreachableException May be thrown if the socket is
- * connected to a currently unreachable destination. Note, there is no
- * guarantee that the exception will be thrown.
- */
- protected abstract void receive(DatagramPacket p) throws IOException;
-
- /**
- * Connects the socket to a host specified by address and port.
- *
- * @param address The <code>InetAddress</code> of the host to connect to
- * @param port The port number of the host to connect to
- *
- * @exception SocketException If an error occurs
- *
- * @since 1.4
- */
- protected void connect(InetAddress address, int port)
- throws SocketException
- {
- // This method has to be overwritten by real implementations
- }
-
- /**
- * Disconnects the socket.
- *
- * @since 1.4
- */
- protected void disconnect()
- {
- // This method has to be overwritten by real implementations
- }
-
- /**
- * Sets the Time to Live (TTL) setting on this socket to the specified
- * value. <b>Use <code>setTimeToLive(int)</code></b> instead.
- *
- * @param ttl The new Time to Live value
- *
- * @exception IOException If an error occurs
- * @deprecated
- */
- protected abstract void setTTL(byte ttl) throws IOException;
-
- /**
- * This method returns the current Time to Live (TTL) setting on this
- * socket. <b>Use <code>getTimeToLive()</code></b> instead.
- *
- * @return the current time-to-live
- *
- * @exception IOException If an error occurs
- *
- * @deprecated // FIXME: when ?
- */
- protected abstract byte getTTL() throws IOException;
-
- /**
- * Sets the Time to Live (TTL) setting on this socket to the specified
- * value.
- *
- * @param ttl The new Time to Live value
- *
- * @exception IOException If an error occurs
- */
- protected abstract void setTimeToLive(int ttl) throws IOException;
-
- /**
- * This method returns the current Time to Live (TTL) setting on this
- * socket.
- *
- * @return the current time-to-live
- *
- * @exception IOException If an error occurs
- */
- protected abstract int getTimeToLive() throws IOException;
-
- /**
- * Causes this socket to join the specified multicast group
- *
- * @param inetaddr The multicast address to join with
- *
- * @exception IOException If an error occurs
- */
- protected abstract void join(InetAddress inetaddr) throws IOException;
-
- /**
- * Causes the socket to leave the specified multicast group.
- *
- * @param inetaddr The multicast address to leave
- *
- * @exception IOException If an error occurs
- */
- protected abstract void leave(InetAddress inetaddr) throws IOException;
-
- /**
- * Causes this socket to join the specified multicast group on a specified
- * device
- *
- * @param mcastaddr The address to leave
- * @param netIf The specified network interface to join the group at
- *
- * @exception IOException If an error occurs
- *
- * @since 1.4
- */
- protected abstract void joinGroup(SocketAddress mcastaddr,
- NetworkInterface netIf)
- throws IOException;
-
- /**
- * Leaves a multicast group
- *
- * @param mcastaddr The address to join
- * @param netIf The specified network interface to leave the group at
- *
- * @exception IOException If an error occurs
- *
- * @since 1.4
- */
- protected abstract void leaveGroup(SocketAddress mcastaddr,
- NetworkInterface netIf)
- throws IOException;
-
- /**
- * Returns the FileDescriptor for this socket
- *
- * @return the file descriptor associated with this socket
- */
- protected FileDescriptor getFileDescriptor()
- {
- return fd;
- }
-
- /**
- * Returns the local port this socket is bound to
- *
- * @return the local port
- */
- protected int getLocalPort()
- {
- return localPort;
- }
-}
Deleted: trunk/core/src/classpath/java/java/net/HttpURLConnection.java
===================================================================
--- trunk/core/src/classpath/java/java/net/HttpURLConnection.java 2009-03-13 20:43:06 UTC (rev 5100)
+++ trunk/core/src/classpath/java/java/net/HttpURLConnection.java 2009-03-14 10:45:16 UTC (rev 5101)
@@ -1,598 +0,0 @@
-/* HttpURLConnection.java -- Subclass of communications links using
- Hypertext Transfer Protocol.
- Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.net;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PushbackInputStream;
-import java.security.Permission;
-
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * Status: Believed complete and correct.
- */
-
-/**
- * This class provides a common abstract implementation for those
- * URL connection classes that will connect using the HTTP protocol.
- * In addition to the functionality provided by the URLConnection
- * class, it defines constants for HTTP return code values and
- * methods for setting the HTTP request method and determining whether
- * or not to follow redirects.
- *
- * @since 1.1
- *
- * @author Warren Levy (wa...@cy...)
- * @author Aaron M. Renn (ar...@ur...)
- */
-public abstract class HttpURLConnection extends URLConnection
-{
- /* HTTP Success Response Codes */
-
- /**
- * Indicates that the client may continue with its request. This value
- * is specified as part of RFC 2068 but was not included in Sun's JDK, so
- * beware of using this value
- */
- static final int HTTP_CONTINUE = 100;
-
- /**
- * Indicates the request succeeded.
- */
- public static final int HTTP_OK = 200;
-
- /**
- * The requested resource has been created.
- */
- public static final int HTTP_CREATED = 201;
-
- /**
- * The request has been accepted for processing but has not completed.
- * There is no guarantee that the requested action will actually ever
- * be completed succesfully, but everything is ok so far.
- */
- public static final int HTTP_ACCEPTED = 202;
-
- /**
- * The meta-information returned in the header is not the actual data
- * from the original server, but may be from a local or other copy.
- * Normally this still indicates a successful completion.
- */
- public static final int HTTP_NOT_AUTHORITATIVE = 203;
-
- /**
- * The server performed the request, but there is no data to send
- * back. This indicates that the user's display should not be changed.
- */
- public static final int HTTP_NO_CONTENT = 204;
-
- /**
- * The server performed the request, but there is no data to sent back,
- * however, the user's display should be "reset" to clear out any form
- * fields entered.
- */
- public static final int HTTP_RESET = 205;
-
- /**
- * The server completed the partial GET request for the resource.
- */
- public static final int HTTP_PARTIAL = 206;
-
- /* HTTP Redirection Response Codes */
-
- /**
- * There is a list of choices available for the requested resource.
- */
- public static final int HTTP_MULT_CHOICE = 300;
-
- /**
- * The resource has been permanently moved to a new location.
- */
- public static final int HTTP_MOVED_PERM = 301;
-
- /**
- * The resource requested has been temporarily moved to a new location.
- */
- public static final int HTTP_MOVED_TEMP = 302;
-
- /**
- * The response to the request issued is available at another location.
- */
- public static final int HTTP_SEE_OTHER = 303;
-
- /**
- * The document has not been modified since the criteria specified in
- * a conditional GET.
- */
- public static final int HTTP_NOT_MODIFIED = 304;
-
- /**
- * The requested resource needs to be accessed through a proxy.
- */
- public static final int HTTP_USE_PROXY = 305;
-
- /* HTTP Client Error Response Codes */
-
- /**
- * The request was misformed or could not be understood.
- */
- public static final int HTTP_BAD_REQUEST = 400;
-
- /**
- * The request made requires user authorization. Try again with
- * a correct authentication header.
- */
- public static final int HTTP_UNAUTHORIZED = 401;
-
- /**
- * Code reserved for future use - I hope way in the future.
- */
- public static final int HTTP_PAYMENT_REQUIRED = 402;
-
- /**
- * There is no permission to access the requested resource.
- */
- public static final int HTTP_FORBIDDEN = 403;
-
- /**
- * The requested resource was not found.
- */
- public static final int HTTP_NOT_FOUND = 404;
-
- /**
- * The specified request method is not allowed for this resource.
- */
- public static final int HTTP_BAD_METHOD = 405;
-
- /**
- * Based on the input headers sent, the resource returned in response
- * to the request would not be acceptable to the client.
- */
- public static final int HTTP_NOT_ACCEPTABLE = 406;
-
- /**
- * The client must authenticate with a proxy prior to attempting this
- * request.
- */
- public static final int HTTP_PROXY_AUTH = 407;
-
- /**
- * The request timed out.
- */
- public static final int HTTP_CLIENT_TIMEOUT = 408;
-
- /**
- * There is a conflict between the current state of the resource and the
- * requested action.
- */
- public static final int HTTP_CONFLICT = 409;
-
- /**
- * The requested resource is no longer available. This ususally indicates
- * a permanent condition.
- */
- public static final int HTTP_GONE = 410;
-
- /**
- * A Content-Length header is required for this request, but was not
- * supplied.
- */
- public static final int HTTP_LENGTH_REQUIRED = 411;
-
- /**
- * A client specified pre-condition was not met on the server.
- */
- public static final int HTTP_PRECON_FAILED = 412;
-
- /**
- * The request sent was too large for the server to handle.
- */
- public static final int HTTP_ENTITY_TOO_LARGE = 413;
-
- /**
- * The name of the resource specified was too long.
- */
- public static final int HTTP_REQ_TOO_LONG = 414;
-
- /**
- * The request is in a format not supported by the requested resource.
- */
- public static final int HTTP_UNSUPPORTED_TYPE = 415;
-
- /* HTTP Server Error Response Codes */
-
- /**
- * This error code indicates that some sort of server error occurred.
- *
- * @deprecated
- */
- public static final int HTTP_SERVER_ERROR = 500;
-
- /**
- * The server encountered an unexpected error (such as a CGI script crash)
- * that prevents the request from being fulfilled.
- */
- public static final int HTTP_INTERNAL_ERROR = 500;
-
- /**
- * The server does not support the requested functionality.
- * @since 1.3
- */
- public static final int HTTP_NOT_IMPLEMENTED = 501;
-
- /**
- * The proxy encountered a bad response from the server it was proxy-ing for
- */
- public static final int HTTP_BAD_GATEWAY = 502;
-
- /**
- * The HTTP service is not availalble, such as because it is overloaded
- * and does not want additional requests.
- */
- public static final int HTTP_UNAVAILABLE = 503;
-
- /**
- * The proxy timed out getting a reply from the remote server it was
- * proxy-ing for.
- */
- public static final int HTTP_GATEWAY_TIMEOUT = 504;
-
- /**
- * This server does not support the protocol version requested.
- */
- public static final int HTTP_VERSION = 505;
-
- // Non-HTTP response static variables
-
- /**
- * Flag to indicate whether or not redirects should be automatically
- * followed by default.
- */
- private static boolean followRedirects = true;
-
- /**
- * This is a list of valid request methods, separated by "|" characters.
- */
- private static final String valid_methods =
- "|GET|POST|HEAD|OPTIONS|PUT|DELETE|TRACE|";
-
- // Instance Variables
-
- /**
- * The requested method in use for this connection. Default is GET.
- */
- protected String method = "GET";
-
- /**
- * The response code received from the server
- */
- protected int responseCode = -1;
-
- /**
- * The response message string received from the server.
- */
- protected String responseMessage;
-
- /**
- * If this instance should follow redirect requests.
- */
- protected boolean instanceFollowRedirects = followRedirects;
-
- /**
- * Whether we already got a valid response code for this connection.
- * Used by <code>getResponseCode()</code> and
- * <code>getResponseMessage()</code>.
- */
- private boolean gotResponseVals;
-
- /**
- * Create an HttpURLConnection for the specified URL
- *
- * @param url The URL to create this connection for.
- */
- protected HttpURLConnection(URL url)
- {
- super(url);
- }
-
- /**
- * Closes the connection to the server.
- */
- public abstract void disconnect();
-
- /**
- * Returns a boolean indicating whether or not this connection is going
- * through a proxy
- *
- * @return true if through a proxy, false otherwise
- */
- public abstract boolean usingProxy();
-
- /**
- * Sets whether HTTP redirects (requests with response code 3xx) should be
- * automatically followed by this class. True by default
- *
- * @param set true if redirects should be followed, false otherwis.
- *
- * @exception SecurityException If a security manager exists and its
- * checkSetFactory method doesn't allow the operation
- */
- public static void setFollowRedirects(boolean set)
- {
- // Throw an exception if an extant security mgr precludes
- // setting the factory.
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkSetFactory();
-
- followRedirects = set;
- }
-
- /**
- * Returns a boolean indicating whether or not HTTP redirects will
- * automatically be followed or not.
- *
- * @return true if redirects will be followed, false otherwise
- */
- public static boolean getFollowRedirects()
- {
- return followRedirects;
- }
-
- /**
- * Returns the value of this HttpURLConnection's instanceFollowRedirects
- * field
- *
- * @return true if following redirects is enabled, false otherwise
- */
- public boolean getInstanceFollowRedirects()
- {
- return instanceFollowRedirects;
- }
-
- /**
- * Sets the value of this HttpURLConnection's instanceFollowRedirects field
- *
- * @param follow true to enable following redirects, false otherwise
- */
- public void setInstanceFollowRedirects(boolean follow)
- {
- instanceFollowRedirects = follow;
- }
-
- /**
- * Set the method for the URL request, one of:
- * GET POST HEAD OPTIONS PUT DELETE TRACE are legal
- *
- * @param method the method to use
- *
- * @exception ProtocolException If the method cannot be reset or if the
- * requested method isn't valid for HTTP
- */
- public void setRequestMethod(String method) throws ProtocolException
- {
- if (connected)
- throw new ProtocolException("Already connected");
-
- method = method.toUpperCase();
- if (valid_methods.indexOf("|" + method + "|") != -1)
- this.method = method;
- else
- throw new ProtocolException("Invalid HTTP request method: " + method);
- }
-
- /**
- * The request method currently in use for this connection.
- *
- * @return The request method
- */
- public String getRequestMethod()
- {
- return method;
- }
-
- /**
- * Gets the status code from an HTTP response message, or -1 if
- * the response code could not be determined.
- * Note that all valid response codes have class variables
- * defined for them in this class.
- *
- * @return The response code
- *
- * @exception IOException If an error occurs
- */
- public int getResponseCode() throws IOException
- {
- if (! gotResponseVals)
- getResponseVals();
- return responseCode;
- }
-
- /**
- * Gets the HTTP response message, if any, returned along with the
- * response code from a server. Null if no response message was set
- * or an error occured while connecting.
- *
- * @return The response message
- *
- * @exception IOException If an error occurs
- */
- public String getResponseMessage() throws IOException
- {
- if (! gotResponseVals)
- getResponseVals();
- return responseMessage;
- }
-
- private void getResponseVals() throws IOException
- {
- // getHeaderField() will connect for us, but do it here first in
- // order to pick up IOExceptions.
- if (! connected)
- connect();
-
- gotResponseVals = true;
-
- // If responseCode not yet explicitly set by subclass
- if (responseCode == -1)
- {
- // Response is the first header received from the connection.
- String respField = getHeaderField(0);
-
- if (respField == null || ! respField.startsWith("HTTP/"))
- {
- // Set to default values on failure.
- responseCode = -1;
- responseMessage = null;
- return;
- }
-
- int firstSpc;
- int nextSpc;
- firstSpc = respField.indexOf(' ');
- nextSpc = respField.indexOf(' ', firstSpc + 1);
- responseMessage = respField.substring(nextSpc + 1);
- String codeStr = respField.substring(firstSpc + 1, nextSpc);
- try
- {
- responseCode = Integer.parseInt(codeStr);
- }
- catch (NumberFormatException e)
- {
- // Set to default values on failure.
- responseCode = -1;
- responseMessage = null;
- }
- }
- }
-
- /**
- * Returns a permission object representing the permission necessary to make
- * the connection represented by this object
- *
- * @return the permission necessary for this connection
- *
- * @exception IOException If an error occurs
- */
- public Permission getPermission() throws IOException
- {
- URL url = getURL();
- String host = url.getHost();
- int port = url.getPort();
- if (port == -1)
- port = 80;
-
- host = host + ":" + port;
-
- return new SocketPermission(host, "connect");
- }
-
- /**
- * This method allows the caller to retrieve any data that might have
- * been sent despite the fact that an error occurred. For example, the
- * HTML page sent along with a 404 File Not Found error. If the socket
- * is not connected, or if no error occurred or no data was returned,
- * this method returns <code>null</code>.
- *
- * @return An <code>InputStream</code> for reading error data.
- */
- public InputStream getErrorStream()
- {
- if (! connected)
- return null;
-
- int code;
- try
- {
- code = getResponseCode();
- }
- catch (IOException e)
- {
- code = -1;
- }
-
- if (code == -1)
- return null;
-
- if (((code / 100) != 4) || ((code / 100) != 5))
- return null;
-
- try
- {
- PushbackInputStream pbis = new PushbackInputStream(getInputStream());
-
- int i = pbis.read();
- if (i == -1)
- return null;
-
- pbis.unread(i);
- return pbis;
- }
- catch (IOException e)
- {
- return null;
- }
- }
-
- /**
- * Returns the value of the named field parsed as date
- *
- * @param key the key of the header field
- * @param value the default value if the header field is not present
- *
- * @return the value of the header field
- */
- public long getHeaderFieldDate(String key, long value)
- {
- // FIXME: implement this correctly
- // http://www.w3.org/Protocols/HTTP-NG/ng-notes.txt
- return super.getHeaderFieldDate(key, value);
- }
- //jnode openjdk
- public void setChunkedStreamingMode(Integer chunkSize) {
- //todo implement it
-
- }
-
- public void setFixedLengthStreamingMode (int contentLength) {
- //todo implement it
- }
-}
Deleted: trunk/core/src/classpath/java/java/net/JarURLConnection.java
===================================================================
--- trunk/core/src/classpath/java/java/net/JarURLConnection.java 2009-03-13 20:43:06 UTC (rev 5100)
+++ trunk/core/src/classpath/java/java/net/JarURLConnection.java 2009-03-14 10:45:16 UTC (rev 5101)
@@ -1,229 +0,0 @@
-/* JarURLConnection.java -- Class for manipulating remote jar files
- Copyright (C) 1998, 2002, 2003, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.net;
-
-import java.io.IOException;
-import java.security.cert.Certificate;
-import java.util.jar.Attributes;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-
-/**
- * This abstract class represents a common superclass for implementations
- * of jar URL's. A jar URL is a special type of URL that allows JAR
- * files on remote systems to be accessed. It has the form:
- * <p>
- * jar:<standard URL pointing to jar filei>!/file/within/jarfile
- * <p> for example:
- * <p>
- * jar:http://www.urbanophile.com/java/foo.jar!/com/urbanophile/bar.class
- * <p>
- * That example URL points to the file /com/urbanophile/bar.class in the
- * remote JAR file http://www.urbanophile.com/java/foo.jar. The HTTP
- *...
[truncated message content] |