Exemplo n.º 1
0
  public RepositoryTargetResource getResourceFromResponse(String responseText) throws IOException {
    LOG.debug(" getResourceFromResponse: " + responseText);

    XStreamRepresentation representation =
        new XStreamRepresentation(xstream, responseText, mediaType);

    RepositoryTargetResourceResponse resourceResponse =
        (RepositoryTargetResourceResponse)
            representation.getPayload(new RepositoryTargetResourceResponse());

    return resourceResponse.getData();
  }
Exemplo n.º 2
0
  public static RepositoryTargetResource get(String targetId) throws IOException {
    String responseText =
        RequestFacade.doGetRequest("service/local/repo_targets/" + targetId).getEntity().getText();
    LOG.debug("responseText: \n" + responseText);

    XStreamRepresentation representation =
        new XStreamRepresentation(
            XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML);

    RepositoryTargetResourceResponse resourceResponse =
        (RepositoryTargetResourceResponse)
            representation.getPayload(new RepositoryTargetResourceResponse());

    return resourceResponse.getData();
  }