< prev index next >

src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java

Print this page

        

@@ -55,11 +55,12 @@
  *
  */
 public class HttpsURLConnectionImpl
         extends javax.net.ssl.HttpsURLConnection {
 
-    private final DelegateHttpsURLConnection delegate;
+    // NOTE: made protected for plugin so that subclass can set it.
+    protected DelegateHttpsURLConnection delegate;
 
     HttpsURLConnectionImpl(URL u, Handler handler) throws IOException {
         this(u, null, handler);
     }
 

@@ -75,10 +76,17 @@
     HttpsURLConnectionImpl(URL u, Proxy p, Handler handler) throws IOException {
         super(checkURL(u));
         delegate = new DelegateHttpsURLConnection(url, p, handler, this);
     }
 
+    // NOTE: introduced for plugin
+    // subclass needs to overwrite this to set delegate to
+    // the appropriate delegatee
+    protected HttpsURLConnectionImpl(URL u) throws IOException {
+        super(u);
+    }
+
     /**
      * Create a new HttpClient object, bypassing the cache of
      * HTTP client objects/connections.
      *
      * @param url       the URL being accessed

@@ -209,15 +217,15 @@
      * - get input, [read input]
      * Disallowed:
      * - get input, [read input,] get output, [write output]
      */
 
-    public OutputStream getOutputStream() throws IOException {
+    public synchronized OutputStream getOutputStream() throws IOException {
         return delegate.getOutputStream();
     }
 
-    public InputStream getInputStream() throws IOException {
+    public synchronized InputStream getInputStream() throws IOException {
         return delegate.getInputStream();
     }
 
     public InputStream getErrorStream() {
         return delegate.getErrorStream();
< prev index next >