Package org.apache.http.client.utils

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


                paths);
    }

    public static URI appendReplicationRequest(URI uri, ReplicationRequest replicationRequest) throws URISyntaxException {
        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


    public static URI appendReplicationRequest(URI uri, ReplicationRequest replicationRequest) throws URISyntaxException {
        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

    public void doRun() {
        final URIBuilder uri;
        final HttpGet get;
        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 ("
View Full Code Here

        final URIBuilder uri;
        final HttpGet get;
        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") + ", "
View Full Code Here

      URIBuilder uriBuilder = new URIBuilder();
      uriBuilder.setScheme(HTTP);
      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);
    }
View Full Code Here

      URIBuilder uriBuilder = new URIBuilder();
      uriBuilder.setScheme(HTTP);
      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);
    }
View Full Code Here

    if (query != null) {
      for (String filter : query.filters) {
        int firstEquals = filter.indexOf('=');
        if (firstEquals == -1) {
          uriBuilder.addParameter("has." + filter, "");
        } else {
          String key = filter.substring(0, firstEquals);
          String value = filter.substring(firstEquals + 1);

          uriBuilder.addParameter("filter." + key, value);
View Full Code Here

          uriBuilder.addParameter("has." + filter, "");
        } else {
          String key = filter.substring(0, firstEquals);
          String value = filter.substring(firstEquals + 1);

          uriBuilder.addParameter("filter." + key, value);
        }
      }

      for (String projection : query.projections) {
        int firstEquals = projection.indexOf('=');
View Full Code Here

      }

      for (String projection : query.projections) {
        int firstEquals = projection.indexOf('=');
        if (firstEquals == -1) {
          uriBuilder.addParameter("select." + projection, "");
        } else {
          throw new IllegalArgumentException();
        }
      }
View Full Code Here

          throw new IllegalArgumentException();
        }
      }

      if (query.flatten) {
        uriBuilder.addParameter("flatten", "true");
      }
    }

    try {
      url = uriBuilder.build();
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.