Package org.restlet.resource

Examples of org.restlet.resource.StringRepresentation


  @Test
  public void emptyTrashTaskOnOneRepo() throws Exception {
    // deploy
    RequestFacade.doPutForText(REPOSITORY_RELATIVE_URL + REPO_TEST_HARNESS_RELEASE_REPO + "/foo.txt",
        new StringRepresentation("dummy content"), NexusRequestMatchers.respondsWithStatusCode(201));
    RequestFacade.doPutForText(REPOSITORY_RELATIVE_URL + REPO_TEST_HARNESS_SNAPSHOT_REPO + "/foo.txt",
        new StringRepresentation("dummy content"), NexusRequestMatchers.respondsWithStatusCode(201));

    // delete both
    RequestFacade.doDelete(REPOSITORY_RELATIVE_URL + REPO_TEST_HARNESS_RELEASE_REPO + "/foo.txt",
        NexusRequestMatchers.respondsWithStatusCode(204));
    RequestFacade.doDelete(REPOSITORY_RELATIVE_URL + REPO_TEST_HARNESS_SNAPSHOT_REPO + "/foo.txt",
View Full Code Here


    // external_role_map
    String uriPart = RequestFacade.SERVICE_LOCAL + "external_role_map/" + source;
    Response response = null;
    String entityText;
    try {
      response = RequestFacade.sendMessage(uriPart, Method.GET, new StringRepresentation("", this.mediaType));
      entityText = response.getEntity().getText();
      assertThat(response, isSuccessful());
    }
    finally {
      RequestFacade.releaseResponse(response);
View Full Code Here


    Response response = null;
    String entityText;
    try {
      response = RequestFacade.sendMessage(uriPart, Method.GET, new StringRepresentation("", this.mediaType));
      entityText = response.getEntity().getText();
      assertThat(response, isSuccessful());
    }
    finally {
      RequestFacade.releaseResponse(response);
View Full Code Here

    if (name.contains("/")) {
      name = name.substring(name.lastIndexOf("/") + 1, name.length());
    }

    return new StringRepresentation(name);
  }
View Full Code Here

    String uriPart = RequestFacade.SERVICE_LOCAL + "plexus_users/" + source;

    Response response = null;
    String entityText;
    try {
      response = RequestFacade.sendMessage(uriPart, Method.GET, new StringRepresentation("", this.mediaType));
      entityText = response.getEntity().getText();
      assertThat(response, isSuccessful());
    }
    finally {
      RequestFacade.releaseResponse(response);
View Full Code Here

    String uriPart = RequestFacade.SERVICE_LOCAL + "plexus_user/" + sourcePart + userId;

    Response response = null;
    String entityText;
    try {
      response = RequestFacade.sendMessage(uriPart, Method.GET, new StringRepresentation("", this.mediaType));
      entityText = response.getEntity().getText();
      assertThat(response, isSuccessful());
    }
    finally {
      RequestFacade.releaseResponse(response);
View Full Code Here

    String uriPart = RequestFacade.SERVICE_LOCAL + "user_search/" + source + "/" + userId;

    Response response = null;
    String entityText;
    try {
      response = RequestFacade.sendMessage(uriPart, Method.GET, new StringRepresentation("", this.mediaType));
      entityText = response.getEntity().getText();
      assertThat(response, isSuccessful());
    }
    finally {
      RequestFacade.releaseResponse(response);
View Full Code Here

      // inputStream
      return new InputStreamRepresentation(variant.getMediaType(), (InputStream) payload);
    }
    else if (String.class.isAssignableFrom(payload.getClass())) {
      // inputStream
      return new StringRepresentation((String) payload, variant.getMediaType());
    }
    else {
      // object, make it a representation
      return serialize(variant, payload);
    }
View Full Code Here

          Status.CLIENT_ERROR_NOT_FOUND,
          "Could not find alias '" + alias + "' for repository '" + repositoryId + "'"
      );
    }

    return new StringRepresentation(version);
  }
View Full Code Here

          Status.SERVER_ERROR_INTERNAL,
          "Could not manage capabilities configuration persistence store"
      );
    }

    return new StringRepresentation(version, TEXT_PLAIN);
  }
View Full Code Here

TOP

Related Classes of org.restlet.resource.StringRepresentation

Copyright © 2018 www.massapicom. 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.