Package org.apache.http.client.utils

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


        URIBuilder uriBuilder = new URIBuilder(uri);
        uriBuilder.addParameter(ReplicationParameter.ACTION.toString(), replicationRequest.getAction().getName());
        for (String path : replicationRequest.getPaths()) {
            uriBuilder.addParameter(ReplicationParameter.PATH.toString(), path);
        }
        return uriBuilder.build();
    }

}
View Full Code Here


        try {
            uri = new URIBuilder(configuration.getVersionchecksUri());
            uri.addParameter("anonid", DigestUtils.sha256Hex(serverStatus.getNodeId().toString()));
            uri.addParameter("version", ServerVersion.VERSION.toString());

            get = new HttpGet(uri.build());
            get.setHeader("User-Agent",
                          "graylog2-server ("
                                  + System.getProperty("java.vendor") + ", "
                                  + System.getProperty("java.version") + ", "
                                  + System.getProperty("os.name") + ", "
View Full Code Here

                    .setSocketTimeout(configuration.getVersionchecksSocketTimeOut())
                    .setConnectionRequestTimeout(configuration.getVersionchecksConnectionRequestTimeOut());
            if (configuration.getHttpProxyUri() != null) {
                try {
                    final URIBuilder uriBuilder = new URIBuilder(configuration.getHttpProxyUri());
                    final URI proxyURI = uriBuilder.build();

                    configBuilder.setProxy(new HttpHost(proxyURI.getHost(), proxyURI.getPort(), proxyURI.getScheme()));
                } catch (Exception e) {
                    LOG.error("Invalid version check proxy URI: " + configuration.getHttpProxyUri(), e);
                    return;
View Full Code Here

                    .setConnectionRequestTimeout(configuration.getTelemetryServiceConnectionRequestTimeOut());

            if (configuration.getHttpProxyUri() != null) {
                try {
                    final URIBuilder uriBuilder = new URIBuilder(configuration.getHttpProxyUri());
                    final URI proxyURI = uriBuilder.build();

                    configBuilder.setProxy(new HttpHost(proxyURI.getHost(), proxyURI.getPort(), proxyURI.getScheme()));
                } catch (Exception e) {
                    LOG.error("Invalid telemetry service proxy URI: {}", configuration.getHttpProxyUri(), e);
                    return;
View Full Code Here

      uriBuilder.setHost(HOST);
      uriBuilder.setPath(path);
      for (NameValuePair param : params) {
        uriBuilder.addParameter(param.getName(), param.getValue());
      }
      uri = uriBuilder.build();
    } catch (URISyntaxException e) {
      throw new ApplicationException("Could not create MusicBrainz URI!", e);
    }
    return uri;
  }
View Full Code Here

      uriBuilder.setHost(HOST);
      uriBuilder.setPath(PATH);
      for (NameValuePair param : params) {
        uriBuilder.addParameter(param.getName(), param.getValue());
      }
      uri = uriBuilder.build();
    } catch (URISyntaxException e) {
      throw new ApplicationException("Could not create Last.fm URI!", e);
    }
    return uri;
  }
View Full Code Here

    try {
      URIBuilder uriBuilder = new URIBuilder();
      uriBuilder.setScheme(HTTP);
      uriBuilder.setHost(HOST);
      uriBuilder.setPath(PATH);
      uri = uriBuilder.build();
    } catch (URISyntaxException e) {
      throw new ApplicationException("Could not create Last.fm URI!", e);
    }
    return uri;
  }
View Full Code Here

        uriBuilder.addParameter("flatten", "true");
      }
    }

    try {
      url = uriBuilder.build();
    } catch (URISyntaxException e) {
      throw new IllegalArgumentException("Error building URI", e);
    }

    HttpGet request = new HttpGet(url);
View Full Code Here

      HttpCallException {

    myLogger.debug("Going to perform remote system HTTP GET request to the the {}", url);

    URIBuilder builder = new URIBuilder(url);
    HttpGet method = new HttpGet(builder.build());
    if (headers != null) {
      for (String headerName : headers.keySet())
        method.addHeader(headerName, headers.get(headerName));
    }
    CloseableHttpResponse response = null;
View Full Code Here

      HttpCallException {

    myLogger.debug("Going to perform remote system HTTP GET request to the the {}", url);

    URIBuilder builder = new URIBuilder(url);
    HttpGet method = new HttpGet(builder.build());
    if (headers != null) {
      for (String headerName : headers.keySet())
        method.addHeader(headerName, headers.get(headerName));
    }
    try {
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.