Package org.apache.http.client.utils

Examples of org.apache.http.client.utils.URIBuilder.build()


          addParam( params, "group", group );
          addParam( params, "file", file );
          addParam( params, "arg", arg );
          addParam( params, "statusdir", statusDir );
          UrlEncodedFormEntity form = new UrlEncodedFormEntity( params );
          HttpPost request = new HttpPost( uri.build() );
          request.setEntity( form );
          return new Response( execute( request ) );
        }
      };
    }
View Full Code Here


        String manifestEtag;
        URIBuilder urlBuild = new URIBuilder(region.getStorageUrl(container, name));
        urlBuild.setParameter("multipart-manifest", "put");
        URI url;
        try {
            url = urlBuild.build();
            InputStreamEntity manifestEntity = new InputStreamEntity(new ByteArrayInputStream(manifest.getBytes()), -1);
            manifestEntity.setChunked(true);
            manifestEntity.setContentType(contentType);
            HttpPut method = new HttpPut(url);
            method.setEntity(manifestEntity);
View Full Code Here

                boolean isSLO = "true".equals(existingMetadata.getMetaData().get(Constants.X_STATIC_LARGE_OBJECT).toLowerCase(Locale.ENGLISH));
                if(isSLO) {
                    final JsonParser parser = new JsonParser();
                    URIBuilder urlBuild = new URIBuilder(region.getStorageUrl(container, name));
                    urlBuild.setParameter("multipart-manifest", "get");
                    URI url = urlBuild.build();
                    HttpGet method = new HttpGet(url);
                    Response response = this.execute(method);
                    if(response.getStatusCode() == HttpStatus.SC_OK) {
                        String manifest = response.getResponseBodyAsString();
                        JsonArray segments = parser.parse(manifest).getAsJsonArray();
View Full Code Here

      builder.addParameter("resource", key.toString());
      builder.addParameter("rel", "http://openid.net/specs/connect/1.0/issuer");

      // do the fetch
      logger.info("Loading: " + builder.toString());
      String webfingerResponse = restTemplate.getForObject(builder.build(), String.class);

      // TODO: catch and handle HTTP errors

      JsonElement json = parser.parse(webfingerResponse);
View Full Code Here

        String redirectUri = request.getRequestURL().toString();
        URIBuilder builder = new URIBuilder(accountChooserUrl);

        builder.addParameter("redirect_uri", redirectUri);

        return new IssuerServiceResponse(builder.build().toString());

      } catch (URISyntaxException e) {
        throw new AuthenticationServiceException("Account Chooser URL is not valid", e);
      }
View Full Code Here

      // check if we need to specify the context
      if (!replaceFlag) {
        // we use HttpPost over HttpPut, for put will replace the entire
        // repo with an empty graph
        logger.info("Using POST to save rdf to triple store");
        HttpPost httpPost = new HttpPost(builder.build());
        httpPost.setEntity(entity);

        // executing the http request
        response = httpclient.execute(httpPost);
      } else {
View Full Code Here

        response = httpclient.execute(httpPost);
      } else {

        // we use HttpPut to replace the context
        logger.info("Using PUT to save rdf to triple store");
        HttpPut httpput = new HttpPut(builder.build());
        httpput.setEntity(entity);

        // executing the http request
        response = httpclient.execute(httpput);
      }
View Full Code Here

        // executing the http request
        response = httpclient.execute(httpput);
      }

      logger.info("request url : " + builder.build().toString());
      logger.info("StatusCode: "
          + response.getStatusLine().getStatusCode());
      logger.info(response.toString());
      int code = response.getStatusLine().getStatusCode();
      if (code >= 200 && code < 300) {
View Full Code Here

    if (params != null) {
      for (NameValuePair param : params) {
        builder.addParameter(param.getName(), param.getValue());
      }
    }
    HttpGet method = new HttpGet(builder.build());
    method.addHeader("Accept", "application/json");
    CloseableHttpResponse response = null;
    try {

      // Preemptive authentication enabled - see
View Full Code Here

                URIBuilder builder = new URIBuilder();
                builder.setPath(PATH);
                for (Map.Entry<String, String> param : queryParams.entrySet()) {
                    builder.setParameter(param.getKey(), param.getValue());
                }
                HttpPost request = new HttpPost(builder.build());
                StringEntity httpEntity = new StringEntity("{}", ContentType.APPLICATION_JSON);
                request.setEntity(httpEntity);
                return request;
            }
        });
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.