Examples of UriBuilder


Examples of org.apache.http.client.utils.URIBuilder

        ProxyClient proxyClient = new ProxyClient("127.0.0.1", getProxyPort()).reset();

        // when
        httpClient.execute(
                new HttpGet(
                        new URIBuilder()
                                .setScheme("http")
                                .setHost("localhost")
                                .setPort(getServerPort())
                                .setPath("/test_headers_and_body")
                                .build()
                )
        );
        httpClient.execute(
                new HttpGet(
                        new URIBuilder()
                                .setScheme("http")
                                .setHost("localhost")
                                .setPort(getServerPort())
                                .setPath("/test_headers_only")
                                .build()
View Full Code Here

Examples of org.apache.http.client.utils.URIBuilder

        ProxyClient proxyClient = new ProxyClient("127.0.0.1", getProxyPort()).reset();

        // when
        httpClient.execute(
                new HttpGet(
                        new URIBuilder()
                                .setScheme("http")
                                .setHost("localhost")
                                .setPort(getServerPort())
                                .setPath("/test_headers_and_body")
                                .build()
                )
        );
        httpClient.execute(
                new HttpGet(
                        new URIBuilder()
                                .setScheme("http")
                                .setHost("localhost")
                                .setPort(getServerPort())
                                .setPath("/test_headers_only")
                                .build()
View Full Code Here

Examples of org.apache.http.client.utils.URIBuilder

  @Override
  public MetricServiceData getMetrics(MetricQuery query) throws RestClientException {
    URI url = metricBaseUrl.resolve("api/metric/").resolve(project + "/");

    URIBuilder uriBuilder = new URIBuilder(url);

    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);
        }
      }

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

      if (query.flatten) {
        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

Examples of org.apache.shindig.common.uri.UriBuilder

          HttpRequest request, OAuthResponseParams responseParams) {
        SecurityToken st = request.getSecurityToken();
        Uri activeUrl = Uri.parse(st.getActiveUrl());
        assertEquals(GADGET_MAKE_REQUEST_URL, activeUrl.toString());
        assertEquals(GadgetTokenStoreTest.DEFAULT_CALLBACK, baseCallback);
        return new UriBuilder()
            .setScheme("http")
            .setAuthority(activeUrl.getAuthority())
            .setPath("/realcallback")
            .toString();
      }
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.core.UriBuilder

            }

      boolean pathPresent = path != null;
      boolean restAnnotationPresent = pathPresent || (httpMethod != null);
     
      UriBuilder builder = new UriBuilder();
      if (base != null)
        builder.path(base);
      if (clazz.isAnnotationPresent(Path.class))
      {
        builder.path(clazz);
      }
      if (path != null)
      {
        builder.path(method);
      }
      String pathExpression = builder.getPath();
      if (pathExpression == null)
      {
        pathExpression = "";
      }
      if (restAnnotationPresent && !Modifier.isPublic(method.getModifiers()))
View Full Code Here

Examples of org.gradle.api.internal.resources.URIBuilder

    private URI uri;

    public GzipArchiver(ReadableResource resource) {
        assert resource != null;
        this.resource = resource;
        this.uri = new URIBuilder(resource.getURI()).schemePrefix("gzip:").build();
    }
View Full Code Here

Examples of org.jclouds.http.Uris.UriBuilder

      baseuri = new URI(URI_SCHEME, this.profile, this.name, null);
    } catch (URISyntaxException e) {
      throw new IllegalArgumentException("Invalid blob profile or path: ", e);
    }

    UriBuilder ub = Uris.uriBuilder(baseuri);

    if (this.compression != null) {
      ub.addQuery(URI_PARAM_COMPRESSION, this.compression);
    }
   
    if (this.encryptionKey != null) {
      ub.addQuery(URI_PARAM_ENCRYPTION_KEY, this.encryptionKey);
    }

    if (this.blockCount != null) {
      ub.addQuery(URI_PARAM_BLOCK_COUNT, Integer.toString(this.blockCount));
    }

    return ub.build();
  }
View Full Code Here

Examples of org.kitesdk.data.URIBuilder

      }
    }
    Dao dao = SpecificAvroDao.buildCompositeDaoWithEntityManager(tablePool,
        tableName, subEntityClasses, schemaManager);
    return new DaoDataset<E>(namespace, name, dao, descriptors.get(0),
        new URIBuilder(repositoryUri, namespace, name).build(), type);
  }
View Full Code Here

Examples of org.kitesdk.data.spi.URIBuilder

      Preconditions.checkNotNull(repositoryURI, "Repository URI is missing");
      this.datasetName = context.getString(
        DatasetSinkConstants.CONFIG_KITE_DATASET_NAME);
      Preconditions.checkNotNull(datasetName, "Dataset name is missing");

      this.target = new URIBuilder(repositoryURI, datasetName).build();
    }

    this.setName(target.toString());

    // other configuration
View Full Code Here

Examples of org.mule.endpoint.URIBuilder

    protected Long frequency;

    @Override
    public Object doGetObject() throws Exception
    {
        uriBuilder = new URIBuilder("polling://" + hashCode(), muleContext);

        properties.put(MessageProcessorPollingMessageReceiver.SOURCE_MESSAGE_PROCESSOR_PROPERTY_NAME, messageProcessor);
        properties.put(AbstractConnector.PROPERTY_POLLING_FREQUENCY, frequency);

        EndpointFactory ef = muleContext.getEndpointFactory();
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.