/** * @deprecated This is half baked stuff */ public ContentListResourceResponse downloadRepoIndexContent(String repoId) throws IOException { String serviceURI = "service/local/repositories/" + repoId + "/index_content/"; String responseText = nexusRestClient.doGetForText(serviceURI); XStreamRepresentation re = new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML); return (ContentListResourceResponse) re.getPayload(new ContentListResourceResponse()); }
/** * @param repoId * @return * @throws java.io.IOException * @deprecated This is half baked stuff */ public ContentListResourceResponse downloadRepoIndexContent( String repoId ) throws IOException { String serviceURI = "service/local/repositories/" + repoId + "/index_content/"; String responseText = nexusRestClient.doGetForText( serviceURI ); XStreamRepresentation re = new XStreamRepresentation( XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML ); ContentListResourceResponse resourceResponse = (ContentListResourceResponse) re.getPayload( new ContentListResourceResponse() ); return resourceResponse; }
@SuppressWarnings("unchecked") public List<ContentListResource> getContentListResource( String repoId, String path, boolean isGroup ) throws IOException { Response response = this.getResponse( repoId, path, isGroup ); String responeText = response.getEntity().getText(); Assert.assertTrue( "Expected sucess: Status was: " + response.getStatus() + "\nResponse:\n" + responeText, response.getStatus().isSuccess() ); XStreamRepresentation representation = new XStreamRepresentation( this.xstream, responeText, this.mediaType ); ContentListResourceResponse listRepsonse = (ContentListResourceResponse) representation .getPayload( new ContentListResourceResponse() ); return listRepsonse.getData(); } }
ContentListResourceResponse response = new ContentListResourceResponse();
public List<ContentListResource> getContentListResource(String repoId, String path, boolean isGroup) throws IOException { Response response = this.getResponse(repoId, path, isGroup); String responeText = response.getEntity().getText(); Assert.assertTrue( "Expected sucess: Status was: " + response.getStatus() + "\nResponse:\n" + responeText, response.getStatus().isSuccess()); XStreamRepresentation representation = new XStreamRepresentation(this.xstream, responeText, this.mediaType); ContentListResourceResponse listRepsonse = (ContentListResourceResponse) representation .getPayload(new ContentListResourceResponse()); return listRepsonse.getData(); } }
ContentListResourceResponse response = new ContentListResourceResponse();