Package javax.net.ssl

Examples of javax.net.ssl.HttpsURLConnection.disconnect()


  } else if (sSourceURI.startsWith("https://")) {
    try {
        URL oUrl = new URL(sSourceURI);
      HttpsURLConnection oCon = (HttpsURLConnection) oUrl.openConnection();
      int iResponseCode = oCon.getResponseCode();
      oCon.disconnect();
      bExists = (iResponseCode>=200 && iResponseCode<=299);
      } catch (MalformedURLException mue) {
        throw new IOException(mue.getMessage());
      }
  }
View Full Code Here


    //
//    dump(is, -1); // simple dump, any cmd
    writeBundle(is, false, "HG10GZ"); // cmd=changegroup
    //writeBundle(is, true, "" or "HG10UN");
    //
    urlConnection.disconnect();
    //
  }

  private static void dump(InputStream is, int limit) throws IOException {
    int b;
View Full Code Here

        } catch (MalformedURLException e) {
          e.printStackTrace();
        } catch (IOException e) {
          e.printStackTrace();
        }
        finally {httpConn.disconnect();}
      }
    }.start();
  }
 
  /**
 
View Full Code Here

            checkResponse(requestInput, conn2);
        } finally {
            TestUtils.unset("javax.net.ssl.trustStore", oldTrustStore);
            TestUtils.unset("javax.net.ssl.trustStorePassword", oldTrustStorePassword);
           
            conn2.disconnect();
        }
    }

    private void checkResponse(InputStream requestInput, HttpURLConnection conn) throws Exception {
        String reply = TestUtils.call(requestInput, conn);
View Full Code Here

            checkWSDL(conn2);
        } finally {
            TestUtils.unset("javax.net.ssl.trustStore", oldTrustStore);
            TestUtils.unset("javax.net.ssl.trustStorePassword", oldTrustStorePassword);
           
            conn2.disconnect();
        }
    }
   
    @Test
    public void testWSDLHttpsAllowGet() throws Exception {
View Full Code Here

            checkResponse(requestInput, conn2);
        } finally {
            TestUtils.unset("javax.net.ssl.trustStore", oldTrustStore);
            TestUtils.unset("javax.net.ssl.trustStorePassword", oldTrustStorePassword);
           
            conn2.disconnect();
        }
    }

    private void checkResponse(InputStream requestInput, HttpURLConnection conn) throws Exception {
        String reply = TestUtils.call(requestInput, conn);
View Full Code Here

            checkWSDL(conn2);
        } finally {
            TestUtils.unset("javax.net.ssl.trustStore", oldTrustStore);
            TestUtils.unset("javax.net.ssl.trustStorePassword", oldTrustStorePassword);
           
            conn2.disconnect();
        }
    }
   
    @Test
    public void testWSDLHttpsAllowGet() throws Exception {
View Full Code Here

                if (httpsConn != null) {
                    String contentLength = httpsConn.getHeaderField("content-length");
                    if (contentLength != null) {
                        remoteSize = Long.parseLong(contentLength);
                    }
                    httpsConn.disconnect();
                }
            }
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException("Invalid URL " + url);
        } catch (IOException e) {
View Full Code Here

        if (url != null) {
            try {
                if (url.getProtocol().equals("https")) {
                    HttpsURLConnection htuc = (HttpsURLConnection)url.openConnection();
                    responseCode = htuc.getResponseCode();
                    htuc.disconnect();
                } else if (url.getProtocol().equals("http")) {
                    HttpURLConnection htuc = (HttpURLConnection)url.openConnection();
                    responseCode = htuc.getResponseCode();
                    htuc.disconnect();
                } else {
View Full Code Here

                    responseCode = htuc.getResponseCode();
                    htuc.disconnect();
                } else if (url.getProtocol().equals("http")) {
                    HttpURLConnection htuc = (HttpURLConnection)url.openConnection();
                    responseCode = htuc.getResponseCode();
                    htuc.disconnect();
                } else {
                    outVal = 1; // invalid protocol
                }
            } catch (IOException ioe) {}
            if (responseCode == HttpURLConnection.HTTP_OK) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.