public List<RepositoryListResource> getAllList() throws IOException { String responseText = nexusRestClient.doGetForText(ALL_SERVICE_PART); LOG.debug("responseText: \n" + responseText); XStreamRepresentation representation = new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML); RepositoryListResourceResponse resourceResponse = (RepositoryListResourceResponse) representation.getPayload(new RepositoryListResourceResponse()); return resourceResponse.getData(); }
throws ResourceException RepositoryListResourceResponse result = new RepositoryListResourceResponse(); result.addData(repoRes);
/** * Method removeData * * @param repositoryListResource */ public void removeData(RepositoryListResource repositoryListResource) { if ( !(repositoryListResource instanceof RepositoryListResource) ) { throw new ClassCastException( "RepositoryListResourceResponse.removeData(repositoryListResource) parameter must be instanceof " + RepositoryListResource.class.getName() ); } getData().remove( repositoryListResource ); } //-- void removeData(RepositoryListResource)
throws ResourceException RepositoryListResourceResponse result = new RepositoryListResourceResponse(); result.addData( repoRes );
/** * Method addData * * @param repositoryListResource */ public void addData(RepositoryListResource repositoryListResource) { if ( !(repositoryListResource instanceof RepositoryListResource) ) { throw new ClassCastException( "RepositoryListResourceResponse.addData(repositoryListResource) parameter must be instanceof " + RepositoryListResource.class.getName() ); } getData().add( repositoryListResource ); } //-- void addData(RepositoryListResource)
public List<RepositoryListResource> getAllList() throws IOException { String responseText = nexusRestClient.doGetForText( ALL_SERVICE_PART ); LOG.debug( "responseText: \n" + responseText ); XStreamRepresentation representation = new XStreamRepresentation( XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML ); RepositoryListResourceResponse resourceResponse = (RepositoryListResourceResponse) representation.getPayload( new RepositoryListResourceResponse() ); return resourceResponse.getData(); }
throws ResourceException RepositoryListResourceResponse result = new RepositoryListResourceResponse(); result.addData(repoRes);
@SuppressWarnings( "unchecked" ) public List<RepositoryListResource> getRepositories() throws NexusConnectionException, NexusClientException { Object tempObj = this.getClientHelper().getList( REPO_SERVICE ); // type check the object so we can have a meaninful error if needed this.checkType( tempObj, RepositoryListResourceResponse.class ); RepositoryListResourceResponse repoResponse = (RepositoryListResourceResponse) tempObj; return repoResponse.getData(); }
/** * This should be replaced with a REST Call, but the REST client does not set the Accept correctly on GET's/ */ public List<RepositoryListResource> getList() throws IOException { String responseText = nexusRestClient.doGetForText(SERVICE_PART); LOG.debug("responseText: \n" + responseText); XStreamRepresentation representation = new XStreamRepresentation(XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML); RepositoryListResourceResponse resourceResponse = (RepositoryListResourceResponse) representation.getPayload(new RepositoryListResourceResponse()); return resourceResponse.getData(); }
throws ResourceException RepositoryListResourceResponse result = new RepositoryListResourceResponse(); result.addData( repoRes );
@Override public Collection<Repository> get() { try { final RepositoryListResourceResponse response = getNexusClient() .serviceResource( "repositories" ) .get( RepositoryListResourceResponse.class ); if ( response.getData() == null || response.getData().isEmpty() ) { return Collections.emptyList(); } List<Repository> repositories = Lists.newArrayList(); for ( final RepositoryListResource resource : response.getData() ) { repositories.add( get( resource.getId() ) ); } return repositories; } catch ( UniformInterfaceException e ) { throw getNexusClient().convert( e ); } catch ( ClientHandlerException e ) { throw getNexusClient().convert( e ); } }
/** * This should be replaced with a REST Call, but the REST client does not set the Accept correctly on GET's/ * * @return * @throws java.io.IOException */ public List<RepositoryListResource> getList() throws IOException { String responseText = nexusRestClient.doGetForText( SERVICE_PART ); LOG.debug( "responseText: \n" + responseText ); XStreamRepresentation representation = new XStreamRepresentation( XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML ); RepositoryListResourceResponse resourceResponse = (RepositoryListResourceResponse) representation.getPayload( new RepositoryListResourceResponse() ); return resourceResponse.getData(); }
/** * This should be replaced with a REST Call, but the REST client does not set the Accept correctly on GET's/ * * @return * @throws IOException */ @SuppressWarnings( "unchecked" ) public List<RepositoryListResource> getList() throws IOException { String responseText = RequestFacade.doGetRequest( "service/local/repositories" ).getEntity().getText(); LOG.debug( "responseText: \n" + responseText ); XStreamRepresentation representation = new XStreamRepresentation( XStreamFactory.getXmlXStream(), responseText, MediaType.APPLICATION_XML ); RepositoryListResourceResponse resourceResponse = (RepositoryListResourceResponse) representation .getPayload( new RepositoryListResourceResponse() ); return resourceResponse.getData(); }