WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

[RFC/PATCH 1/2] Add missing Java 1.5 java/net classes

View: New views
6 Messages — Rating Filter:   Alert me  

[RFC/PATCH 1/2] Add missing Java 1.5 java/net classes

by Pekka Enberg-4 :: Rate this Message:

| View Threaded | Show Only this Message

Signed-off-by: Pekka Enberg <penberg@...>
---
 java/net/CacheRequest.java        |   52 ++++++++++++++++++++++++
 java/net/CacheResponse.java       |   55 +++++++++++++++++++++++++
 java/net/CookieHandler.java       |   68 +++++++++++++++++++++++++++++++
 java/net/HttpRetryException.java  |   80 +++++++++++++++++++++++++++++++++++++
 java/net/ResponseCache.java       |   69 +++++++++++++++++++++++++++++++
 java/net/SecureCacheResponse.java |   55 +++++++++++++++++++++++++
 6 files changed, 379 insertions(+), 0 deletions(-)
 create mode 100644 java/net/CacheRequest.java
 create mode 100644 java/net/CacheResponse.java
 create mode 100644 java/net/CookieHandler.java
 create mode 100644 java/net/HttpRetryException.java
 create mode 100644 java/net/ResponseCache.java
 create mode 100644 java/net/SecureCacheResponse.java

diff --git a/java/net/CacheRequest.java b/java/net/CacheRequest.java
new file mode 100644
index 0000000..23e0d9e
--- /dev/null
+++ b/java/net/CacheRequest.java
@@ -0,0 +1,52 @@
+/* CacheRequest.java --
+   Copyright (C) 2012  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.io.OutputStream;
+
+
+/**
+ * @since 1.5
+ */
+public abstract class CacheRequest
+{
+  public abstract OutputStream getBody() throws IOException;
+
+  public abstract void abort();
+}
diff --git a/java/net/CacheResponse.java b/java/net/CacheResponse.java
new file mode 100644
index 0000000..d4cf95f
--- /dev/null
+++ b/java/net/CacheResponse.java
@@ -0,0 +1,55 @@
+/* CacheResponse.java --
+   Copyright (C) 2012  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.io.InputStream;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @since 1.5
+ */
+public abstract class CacheResponse
+{
+  public abstract InputStream getBody() throws IOException;
+
+  public abstract Map<String, List<String>> getHeaders() throws IOException;
+}
diff --git a/java/net/CookieHandler.java b/java/net/CookieHandler.java
new file mode 100644
index 0000000..c551f5d
--- /dev/null
+++ b/java/net/CookieHandler.java
@@ -0,0 +1,68 @@
+/* CookieHandler.java --
+   Copyright (C) 2012  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.util.List;
+import java.util.Map;
+
+
+/**
+ * @since 1.5
+ */
+public abstract class CookieHandler
+{
+  private static CookieHandler defaultHandler;
+
+  public static CookieHandler getDefault()
+  {
+    return defaultHandler;
+  }
+
+  public static void setDefault(CookieHandler handler)
+  {
+    defaultHandler = handler;
+  }
+
+  public abstract Map<String, List<String>> get(URI uri, Map<String,
+                                                List<String>> requestHeaders)
+    throws IOException;
+
+  public abstract void put(URI uri, Map<String, List<String>> responseHeaders)
+    throws IOException;
+}
diff --git a/java/net/HttpRetryException.java b/java/net/HttpRetryException.java
new file mode 100644
index 0000000..2b51bc5
--- /dev/null
+++ b/java/net/HttpRetryException.java
@@ -0,0 +1,80 @@
+/* HttpRetryException.java --
+   Copyright (C) 2012  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;
+
+
+/**
+ * @since 1.5
+ */
+public class HttpRetryException
+  extends IOException
+{
+  private final String reason;
+  private final int responseCode;
+  private final String location;
+
+  public HttpRetryException(String reason, int responseCode)
+  {
+    this(reason, responseCode, null);
+  }
+
+  public HttpRetryException(String reason, int responseCode, String location)
+  {
+    this.reason = reason;
+    this.responseCode = responseCode;
+    this.location = location;
+  }
+
+  public int responseCode()
+  {
+    return this.responseCode;
+  }
+
+  public String getReason()
+  {
+    return reason;
+  }
+
+  public String getLocation()
+  {
+    return location;
+  }
+
+}
diff --git a/java/net/ResponseCache.java b/java/net/ResponseCache.java
new file mode 100644
index 0000000..179fa5f
--- /dev/null
+++ b/java/net/ResponseCache.java
@@ -0,0 +1,69 @@
+/* ResponseCache.java --
+   Copyright (C) 2012  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.util.List;
+import java.util.Map;
+
+
+/**
+ * @since 1.5
+ */
+public abstract class ResponseCache
+{
+  private static ResponseCache defaultCache;
+
+  public static ResponseCache getDefault()
+  {
+    return defaultCache;
+  }
+
+  public static void setDefault(ResponseCache cache)
+  {
+    defaultCache = cache;
+  }
+
+  public abstract CacheResponse get(URI uri, String requestMethod,
+                                    Map<String, List<String>> requestHeaders)
+    throws IOException;
+
+  public abstract CacheRequest put(URI uri, URLConnection connection)
+    throws IOException;
+
+}
diff --git a/java/net/SecureCacheResponse.java b/java/net/SecureCacheResponse.java
new file mode 100644
index 0000000..e405484
--- /dev/null
+++ b/java/net/SecureCacheResponse.java
@@ -0,0 +1,55 @@
+/* SecureCacheResponse.java --
+   Copyright (C) 2012  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.security.Principal;
+import java.security.cert.Certificate;
+import java.util.List;
+import javax.net.ssl.SSLPeerUnverifiedException;
+
+
+/**
+ * @since 1.5
+ */
+public abstract class SecureCacheResponse
+  extends CacheResponse
+{
+  public abstract String getCipherSuite();
+  public abstract List<Certificate> getLocalCertificateChain();
+  public abstract Principal getLocalPrincipal();
+}
--
1.7.6.5



[RFC/PATCH 2/2] Add missing Java 1.5 java/net methods

by Pekka Enberg-4 :: Rate this Message:

| View Threaded | Show Only this Message

Signed-off-by: Pekka Enberg <penberg@...>
---
 java/net/ServerSocket.java |    8 ++++++++
 java/net/Socket.java       |    8 ++++++++
 java/net/SocketImpl.java   |    8 ++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/java/net/ServerSocket.java b/java/net/ServerSocket.java
index 1dbd763..453fb29 100644
--- a/java/net/ServerSocket.java
+++ b/java/net/ServerSocket.java
@@ -584,6 +584,14 @@ public class ServerSocket
   }
 
   /**
+   * @since 1.5
+   */
+  public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
+  {
+    // Ignored
+  }
+
+  /**
    * Returns the value of this socket as a <code>String</code>.
    *
    * @return This socket represented as a <code>String</code>.
diff --git a/java/net/Socket.java b/java/net/Socket.java
index 32b12e8..26490e3 100644
--- a/java/net/Socket.java
+++ b/java/net/Socket.java
@@ -1294,4 +1294,12 @@ public class Socket
   {
     return outputShutdown;
   }
+
+  /**
+   * @since 1.5
+   */
+  public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
+  {
+    // Ignored
+  }
 }
diff --git a/java/net/SocketImpl.java b/java/net/SocketImpl.java
index 77f470b..ab3b636 100644
--- a/java/net/SocketImpl.java
+++ b/java/net/SocketImpl.java
@@ -318,4 +318,12 @@ public abstract class SocketImpl implements SocketOptions
   {
     throw new IOException("Not implemented in this socket class");
   }
+
+  /**
+   * @since 1.5
+   */
+  public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
+  {
+    // Ignored
+  }
 }
--
1.7.6.5



Re: [RFC/PATCH 1/2] Add missing Java 1.5 java/net classes

by ahughes-2 :: Rate this Message:

| View Threaded | Show Only this Message



----- Original Message -----

> Signed-off-by: Pekka Enberg <penberg@...>
> ---
>  java/net/CacheRequest.java        |   52 ++++++++++++++++++++++++
>  java/net/CacheResponse.java       |   55 +++++++++++++++++++++++++
>  java/net/CookieHandler.java       |   68
>  +++++++++++++++++++++++++++++++
>  java/net/HttpRetryException.java  |   80
>  +++++++++++++++++++++++++++++++++++++
>  java/net/ResponseCache.java       |   69
>  +++++++++++++++++++++++++++++++
>  java/net/SecureCacheResponse.java |   55 +++++++++++++++++++++++++
>  6 files changed, 379 insertions(+), 0 deletions(-)
>  create mode 100644 java/net/CacheRequest.java
>  create mode 100644 java/net/CacheResponse.java
>  create mode 100644 java/net/CookieHandler.java
>  create mode 100644 java/net/HttpRetryException.java
>  create mode 100644 java/net/ResponseCache.java
>  create mode 100644 java/net/SecureCacheResponse.java
>
> diff --git a/java/net/CacheRequest.java b/java/net/CacheRequest.java
> new file mode 100644
> index 0000000..23e0d9e
> --- /dev/null
> +++ b/java/net/CacheRequest.java
> @@ -0,0 +1,52 @@
> +/* CacheRequest.java --
> +   Copyright (C) 2012  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.io.OutputStream;
> +
> +
> +/**
> + * @since 1.5
> + */
> +public abstract class CacheRequest
> +{
> +  public abstract OutputStream getBody() throws IOException;
> +
> +  public abstract void abort();
> +}
> diff --git a/java/net/CacheResponse.java
> b/java/net/CacheResponse.java
> new file mode 100644
> index 0000000..d4cf95f
> --- /dev/null
> +++ b/java/net/CacheResponse.java
> @@ -0,0 +1,55 @@
> +/* CacheResponse.java --
> +   Copyright (C) 2012  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.io.InputStream;
> +
> +import java.util.List;
> +import java.util.Map;
> +
> +
> +/**
> + * @since 1.5
> + */
> +public abstract class CacheResponse
> +{
> +  public abstract InputStream getBody() throws IOException;
> +
> +  public abstract Map<String, List<String>> getHeaders() throws
> IOException;
> +}
> diff --git a/java/net/CookieHandler.java
> b/java/net/CookieHandler.java
> new file mode 100644
> index 0000000..c551f5d
> --- /dev/null
> +++ b/java/net/CookieHandler.java
> @@ -0,0 +1,68 @@
> +/* CookieHandler.java --
> +   Copyright (C) 2012  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.util.List;
> +import java.util.Map;
> +
> +
> +/**
> + * @since 1.5
> + */
> +public abstract class CookieHandler
> +{
> +  private static CookieHandler defaultHandler;
> +
> +  public static CookieHandler getDefault()
> +  {
> +    return defaultHandler;
> +  }
> +
> +  public static void setDefault(CookieHandler handler)
> +  {
> +    defaultHandler = handler;
> +  }
> +
> +  public abstract Map<String, List<String>> get(URI uri, Map<String,
> +                                                List<String>>
> requestHeaders)
> +    throws IOException;
> +
> +  public abstract void put(URI uri, Map<String, List<String>>
> responseHeaders)
> +    throws IOException;
> +}
> diff --git a/java/net/HttpRetryException.java
> b/java/net/HttpRetryException.java
> new file mode 100644
> index 0000000..2b51bc5
> --- /dev/null
> +++ b/java/net/HttpRetryException.java
> @@ -0,0 +1,80 @@
> +/* HttpRetryException.java --
> +   Copyright (C) 2012  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;
> +
> +
> +/**
> + * @since 1.5
> + */
> +public class HttpRetryException
> +  extends IOException
> +{
> +  private final String reason;
> +  private final int responseCode;
> +  private final String location;
> +
> +  public HttpRetryException(String reason, int responseCode)
> +  {
> +    this(reason, responseCode, null);
> +  }
> +
> +  public HttpRetryException(String reason, int responseCode, String
> location)
> +  {
> +    this.reason = reason;
> +    this.responseCode = responseCode;
> +    this.location = location;
> +  }
> +
> +  public int responseCode()
> +  {
> +    return this.responseCode;
> +  }
> +
> +  public String getReason()
> +  {
> +    return reason;
> +  }
> +
> +  public String getLocation()
> +  {
> +    return location;
> +  }
> +
> +}
> diff --git a/java/net/ResponseCache.java
> b/java/net/ResponseCache.java
> new file mode 100644
> index 0000000..179fa5f
> --- /dev/null
> +++ b/java/net/ResponseCache.java
> @@ -0,0 +1,69 @@
> +/* ResponseCache.java --
> +   Copyright (C) 2012  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.util.List;
> +import java.util.Map;
> +
> +
> +/**
> + * @since 1.5
> + */
> +public abstract class ResponseCache
> +{
> +  private static ResponseCache defaultCache;
> +
> +  public static ResponseCache getDefault()
> +  {
> +    return defaultCache;
> +  }
> +
> +  public static void setDefault(ResponseCache cache)
> +  {
> +    defaultCache = cache;
> +  }
> +
> +  public abstract CacheResponse get(URI uri, String requestMethod,
> +                                    Map<String, List<String>>
> requestHeaders)
> +    throws IOException;
> +
> +  public abstract CacheRequest put(URI uri, URLConnection
> connection)
> +    throws IOException;
> +
> +}
> diff --git a/java/net/SecureCacheResponse.java
> b/java/net/SecureCacheResponse.java
> new file mode 100644
> index 0000000..e405484
> --- /dev/null
> +++ b/java/net/SecureCacheResponse.java
> @@ -0,0 +1,55 @@
> +/* SecureCacheResponse.java --
> +   Copyright (C) 2012  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.security.Principal;
> +import java.security.cert.Certificate;
> +import java.util.List;
> +import javax.net.ssl.SSLPeerUnverifiedException;
> +
> +
> +/**
> + * @since 1.5
> + */
> +public abstract class SecureCacheResponse
> +  extends CacheResponse
> +{
> +  public abstract String getCipherSuite();
> +  public abstract List<Certificate> getLocalCertificateChain();
> +  public abstract Principal getLocalPrincipal();
> +}
> --
> 1.7.6.5
>
>
>

The CookieHandler is the main one that concerns me here.  We're providing
getDefault() but it's going to return null unless someone sets it.  That is
valid, but I'm worried it gives the impression we implement something when
really we just provide the interfaces.  Also, both getDefault and setDefault
are supposed to perform security checks.

I also worry a lot of code is being added here without documentation.
--
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07



Re: [RFC/PATCH 2/2] Add missing Java 1.5 java/net methods

by ahughes-2 :: Rate this Message:

| View Threaded | Show Only this Message

----- Original Message -----

> Signed-off-by: Pekka Enberg <penberg@...>
> ---
>  java/net/ServerSocket.java |    8 ++++++++
>  java/net/Socket.java       |    8 ++++++++
>  java/net/SocketImpl.java   |    8 ++++++++
>  3 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/java/net/ServerSocket.java b/java/net/ServerSocket.java
> index 1dbd763..453fb29 100644
> --- a/java/net/ServerSocket.java
> +++ b/java/net/ServerSocket.java
> @@ -584,6 +584,14 @@ public class ServerSocket
>    }
>  
>    /**
> +   * @since 1.5
> +   */
> +  public void setPerformancePreferences(int connectionTime, int
> latency, int bandwidth)
> +  {
> +    // Ignored
> +  }
> +
> +  /**
>     * Returns the value of this socket as a <code>String</code>.
>     *
>     * @return This socket represented as a <code>String</code>.
> diff --git a/java/net/Socket.java b/java/net/Socket.java
> index 32b12e8..26490e3 100644
> --- a/java/net/Socket.java
> +++ b/java/net/Socket.java
> @@ -1294,4 +1294,12 @@ public class Socket
>    {
>      return outputShutdown;
>    }
> +
> +  /**
> +   * @since 1.5
> +   */
> +  public void setPerformancePreferences(int connectionTime, int
> latency, int bandwidth)
> +  {
> +    // Ignored
> +  }
>  }
> diff --git a/java/net/SocketImpl.java b/java/net/SocketImpl.java
> index 77f470b..ab3b636 100644
> --- a/java/net/SocketImpl.java
> +++ b/java/net/SocketImpl.java
> @@ -318,4 +318,12 @@ public abstract class SocketImpl implements
> SocketOptions
>    {
>      throw new IOException("Not implemented in this socket class");
>    }
> +
> +  /**
> +   * @since 1.5
> +   */
> +  public void setPerformancePreferences(int connectionTime, int
> latency, int bandwidth)
> +  {
> +    // Ignored
> +  }
>  }
> --
> 1.7.6.5
>
>
>

I don't see how this is better than just not having these APIs.  Shouldn't
they at least delegate to VM level?
--
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07



Re: [RFC/PATCH 2/2] Add missing Java 1.5 java/net methods

by Pekka Enberg-4 :: Rate this Message:

| View Threaded | Show Only this Message

On Wed, Mar 14, 2012 at 8:22 PM, Andrew Hughes <ahughes@...> wrote:
> I don't see how this is better than just not having these APIs.  Shouldn't
> they at least delegate to VM level?

That's what the API does with OpenJDK too! Also, the VM is not really
involved for networking code so I don't see why we'd need to delegate
anything.


Re: [RFC/PATCH 2/2] Add missing Java 1.5 java/net methods

by ahughes-2 :: Rate this Message:

| View Threaded | Show Only this Message



----- Original Message -----

> On Wed, Mar 14, 2012 at 8:22 PM, Andrew Hughes <ahughes@...>
> wrote:
> > I don't see how this is better than just not having these APIs.
> >  Shouldn't
> > they at least delegate to VM level?
>
> That's what the API does with OpenJDK too! Also, the VM is not really
> involved for networking code so I don't see why we'd need to delegate
> anything.
>

Well they at least need to be documented and the lack of implementation noted therein.
--
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07