Package com.sun.jersey.api.client

Examples of com.sun.jersey.api.client.WebResource.queryParam()


        }
        if (end != null) {
            resource = resource.queryParam("end", end);
        }
        if (runid != null) {
            resource = resource.queryParam("runid", runid);
        }
        if (colo != null) {
            resource = resource.queryParam("colo", colo);
        }
View Full Code Here


        }
        if (runid != null) {
            resource = resource.queryParam("runid", runid);
        }
        if (colo != null) {
            resource = resource.queryParam("colo", colo);
        }

        ClientResponse clientResponse;
        if (props == null) {
            clientResponse = resource
View Full Code Here

        File tmpFile = TestContext.getTempFile();
        entity.getEntityType().getMarshaller().marshal(entity, tmpFile);
        WebResource resource = context.service.path("api/entities/update/"
                + entity.getEntityType().name().toLowerCase() + "/" + entity.getName());
        if (endTime != null) {
            resource = resource.queryParam("effective", SchemaHelper.formatDateUTC(endTime));
        }
        ClientResponse response = resource
                .header("Cookie", context.getAuthenticationToken())
                .accept(MediaType.TEXT_XML)
                .post(ClientResponse.class, context.getServletInputStream(tmpFile.getAbsolutePath()));
View Full Code Here

  @Override public final void processTrial(Trial trial) {
    if (uploadUri.isPresent()) {
      WebResource resource = client.resource(uploadUri.get());
      if (apiKey.isPresent()) {
        resource = resource.queryParam("key", apiKey.get().toString());
      }
      boolean threw = true;
      try {
        // TODO(gak): make the json part happen automagically
        resource.type(APPLICATION_JSON_TYPE).post(gson.toJson(ImmutableList.of(trial)));
View Full Code Here

  public ActionResponse put( @Nonnull DocId docId, @Nullable Revision revision, @Nonnull MediaType mediaType, @Nonnull InputStream content ) throws ActionFailedException {
    WebResource resource = dbRoot.path( docId.asString() );

    //Add the revision is necessary
    if ( revision != null ) {
      resource = resource.queryParam( PARAM_REV, revision.asString() );
    }

    if ( logger.isLoggable( Level.FINE ) ) {
      logger.fine( "HEAD " + resource.toString() );
    }
View Full Code Here

      .path( docId.asString() )
      .path( attachmentId.asString() );

    //Add the revision is necessary
    if ( revision != null ) {
      resource = resource.queryParam( PARAM_REV, revision.asString() );
    }

    if ( logger.isLoggable( Level.FINE ) ) {
      logger.fine( "PUT " + resource.toString() );
    }
View Full Code Here

                    CreateMode.PERSISTENT);
        }

        WebResource wr = r.path(path).queryParam("dataformat", encoding);
        if (data == null) {
            wr = wr.queryParam("null", "true");
        }

        Builder builder = wr.accept(accept)
            .type(MediaType.APPLICATION_OCTET_STREAM);
View Full Code Here

        LOG.info("STARTING " + getName());

        WebResource wr = r.path(path).queryParam("dataformat", encoding)
            .queryParam("name", name);
        if (data == null) {
            wr = wr.queryParam("null", "true");
        }
        if (sequence) {
            wr = wr.queryParam("sequence", "true");
        }
View Full Code Here

            .queryParam("name", name);
        if (data == null) {
            wr = wr.queryParam("null", "true");
        }
        if (sequence) {
            wr = wr.queryParam("sequence", "true");
        }

        Builder builder = wr.accept(accept);

        ClientResponse cr;
View Full Code Here

        Assert.assertEquals(200, response.getStatus()); // 200 = ok

        System.out.println(response.getEntity(String.class));

        System.out.println("**** CustomerResource With Query params ***");
        response = wr.queryParam("start", "1").queryParam("size", "3").get(ClientResponse.class);
        Assert.assertEquals(200, response.getStatus()); // 200 = ok

        System.out.println(response.getEntity(String.class));

        System.out.println("**** CustomerResource With UriInfo and Query params ***");
 
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.