Examples of HttpConnection


Examples of HTTPClient.HTTPConnection

            progressBar.setString("");
            progressBar.setValue(0);
        }

        // create a connection for figuring out what we need to grab
        final HTTPConnection searchConnection = new HTTPConnection(host);

        // prepare a stream to determine the number of pages in the result set
        final String searchUrlPath = "/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=10GN481Z3YQ4S67KNSG2&Operation=ItemSearch&SearchIndex=DVD&ResponseGroup=ItemIds&Keywords=" + keywords;

        // parse the number of results from the stream
View Full Code Here

Examples of HTTPClient.HTTPConnection

            this.requestEnqueuer = new RequestEnqueuer();

            this.target.addListEventListener(this.progressBarUpdater);
            this.itemASINs.addListEventListener(requestEnqueuer);

            this.httpConnection = new HTTPConnection(host);
        }
View Full Code Here

Examples of com.cuubez.core.io.HttpConnection

    }


    public void writeResponse(HttpServletRequest request, HttpServletResponse response, ResponseContext responseContext) {

        Connection connection = new HttpConnection();
        connection.write(request, response, responseContext);
    }
View Full Code Here

Examples of com.findwise.tools.HttpConnection

        }
        if(System.currentTimeMillis()-timeout > startTime) {
            return false;
        }
        if (isExecuting()) {
            HttpConnection conn = new HttpConnection("localhost", port);
            try {
                HttpResponse response = conn.get("/");
                String result = EntityUtils.toString(response.getEntity());
                if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    return result.equals(id);
                }
            }
View Full Code Here

Examples of com.sibvisions.rad.remote.http.HttpConnection

      if (sServerBase == null)
      {
        sServerBase = "http://localhost/${artifactId}";
      }
     
      return new HttpConnection(sServerBase + "/services/Server");
    }
   
    //client + server in one JVM
    return new DirectServerConnection();
  }
View Full Code Here

Examples of com.subgraph.orchid.directory.downloader.HttpConnection

    logger.fine("Downloading descriptor from "+ dd.getDirectory());
   
    Stream stream = null;
    try {
      stream = openHSDirectoryStream(dd.getDirectory());
      HttpConnection http = new HttpConnection(stream);
      http.sendGetRequest("/tor/rendezvous2/"+ dd.getDescriptorId().toBase32());
      http.readResponse();
      if(http.getStatusCode() == 200) {
        return readDocument(dd, http.getMessageBody());
      } else {
        logger.fine("HS descriptor download for "+ hiddenService.getOnionAddressForLogging() + " failed with status "+ http.getStatusCode());
      }
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      return null;
    } catch (TimeoutException e) {
View Full Code Here

Examples of hamsam.net.HttpConnection

                    proxyPort = proxyInfo.getServerPort();
                    proxyUsername = proxyInfo.getUsername();
                    proxyPassword = proxyInfo.getPassword();

                    if ((proxyUsername == null) || (proxyPassword == null)) {
                        this.conn = new HttpConnection(proxyHost, proxyPort, host, port);
                    } else {
                        this.conn = new HttpConnection(proxyHost, proxyPort, proxyUsername, proxyPassword, host, port);
                    }

                    break;
            }
        } catch (IOException e) {
View Full Code Here

Examples of io.lumify.http.HttpConnection

    }

    private void discoverEndpoints() {
        try {
            HttpGetMethod getMethod = new HttpGetMethod(new URL(DISCOVERY_DOC_URL));
            HttpConnection conn = getMethod.openConnection();

            if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
                throw new LumifyException("Failed to retrieve OpenID Connect discovery document");
            }

            JSONObject json = new JSONObject(conn.getResponseAsString());
            this.authorizationEndpoint = json.getString("authorization_endpoint");
            checkNotNull(this.authorizationEndpoint);
            this.tokenEndpoint = json.getString("token_endpoint");
            checkNotNull(this.tokenEndpoint);
            this.userInfoEndpoint = json.getString("userinfo_endpoint");
View Full Code Here

Examples of io.lumify.http.HttpConnection

        postMethod.addRequestParameter("code", code);
        postMethod.addRequestParameter("client_id", this.config.getKey());
        postMethod.addRequestParameter("client_secret", this.config.getSecret());
        postMethod.addRequestParameter("redirect_uri", httpRequest.getRequestURL().toString());
        postMethod.addRequestParameter("grant_type", "authorization_code");
        HttpConnection accessTokenConnection = postMethod.openConnection();

        if (accessTokenConnection.getResponseCode() != HttpURLConnection.HTTP_OK) {
            LOGGER.error("Access token request failed: %s", accessTokenConnection.getResponseMessage());
            httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
            return null;
        }

        String accessTokenResponse = accessTokenConnection.getResponseAsString();
        return new JSONObject(accessTokenResponse);
    }
View Full Code Here

Examples of io.lumify.http.HttpConnection

    }

    private JSONObject getUserInfo(String accessToken, String tokenType, HttpServletResponse httpResponse) throws IOException {
        HttpGetMethod getMethod = new HttpGetMethod(new URL(this.userInfoEndpoint));
        getMethod.setHeader("Authorization", tokenType + " " + accessToken);
        HttpConnection userInfoConnection = getMethod.openConnection();

        if (userInfoConnection.getResponseCode() != HttpURLConnection.HTTP_OK) {
            LOGGER.error("Request for user information failed: %s", userInfoConnection.getResponseMessage());
            httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
            return null;
        }

        return new JSONObject(userInfoConnection.getResponseAsString());
    }
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.