/** * IMPORTANT: Make sure to release the Response in a finally block when you are done with it. */ public Response sendMessage(Method method, RepositoryBaseResource resource) throws IOException { return sendMessage(method, resource, resource.getId()); }
public JerseyRepository( final JerseyNexusClient nexusClient, final S settings ) { this( nexusClient, checkNotNull( checkNotNull( settings ).getId() ) ); this.shouldCreate = false; overwriteSettingsWith( settings ); }
/** * IMPORTANT: Make sure to release the Response in a finally block when you are done with it. */ public Response sendMessage( Method method, RepositoryBaseResource resource ) throws IOException { return sendMessage( method, resource, resource.getId() ); }
public Response sendMessage( Method method, RepositoryBaseResource resource ) throws IOException { return this.sendMessage( method, resource, resource.getId() ); }
public RepositoryBaseResource updateRepository( RepositoryBaseResource repo ) throws NexusConnectionException, NexusClientException { RepositoryResourceResponse repoResponseRequest = new RepositoryResourceResponse(); repoResponseRequest.setData( repo ); Object tempObj = this.getClientHelper().update( REPO_SERVICE, repo.getId(), repoResponseRequest ); // Hack around NEXUS-540 if ( tempObj == null ) { return this.getRepository( repo.getId() ); } // type check the object so we can have a meaninful error if needed this.checkType( tempObj, RepositoryResourceResponse.class ); RepositoryResourceResponse repoResponse = (RepositoryResourceResponse) tempObj; return repoResponse.getData(); }
public void validateResourceResponse( RepositoryBaseResource repo, RepositoryBaseResource responseResource ) throws IOException Assert.assertEquals( repo.getId(), responseResource.getId() ); Assert.assertEquals( repo.getName(), responseResource.getName() ); + repo.getId() + "/ <actual>" + actual.getDefaultLocalStorageUrl(), actual .getDefaultLocalStorageUrl().endsWith( "runtime/work/storage/" + repo.getId() + "/" ) ); + repo.getId() + " <actual>" + actual.getDefaultLocalStorageUrl(), actual .getDefaultLocalStorageUrl().endsWith( "runtime/work/storage/" + repo.getId() ) );
public RepositoryBaseResource updateRepo( RepositoryBaseResource repo ) throws IOException { Response response = this.sendMessage( Method.PUT, repo ); if ( !response.getStatus().isSuccess() ) { String responseText = response.getEntity().getText(); Assert.fail( "Could not update user: " + response.getStatus() + "\n" + responseText ); } // this doesn't return any objects, it should.... // // get the Resource object // RepositoryResource responseResource = this.getResourceFromResponse( response ); // for now call GET RepositoryBaseResource responseResource = this.getRepository( repo.getId() ); this.validateResourceResponse( repo, responseResource ); return responseResource; }
public RepositoryBaseResource createRepository( RepositoryBaseResource repo ) throws IOException { Response response = this.sendMessage( Method.POST, repo ); if ( !response.getStatus().isSuccess() ) { String responseText = response.getEntity().getText(); Assert.fail( "Could not create Repository: " + response.getStatus() + ":\n" + responseText ); } // // get the Resource object // RepositoryResource responseResource = this.getResourceFromResponse( response ); // currently create doesn't return anything, it should see NEXUS-540 // the work around is to call get at this point RepositoryBaseResource responseResource = this.getRepository( repo.getId() ); // GET always uses XML, due to a // problem in the RESTlet client this.validateResourceResponse( repo, responseResource ); return responseResource; }
public void validateResourceResponse(RepositoryBaseResource repo, RepositoryBaseResource responseResource) throws IOException Assert.assertEquals(responseResource.getId(), repo.getId()); Assert.assertEquals(responseResource.getName(), repo.getName()); + repo.getId() + "/ <actual>" + actual.getDefaultLocalStorageUrl(), actual.getDefaultLocalStorageUrl().endsWith("/storage/" + repo.getId() + "/")); + repo.getId() + " <actual>" + actual.getDefaultLocalStorageUrl(), actual.getDefaultLocalStorageUrl().endsWith("/storage/" + repo.getId()));
public RepositoryBaseResource createRepository( RepositoryBaseResource repo ) throws NexusConnectionException, NexusClientException { RepositoryResourceResponse repoResponseRequest = new RepositoryResourceResponse(); repoResponseRequest.setData( repo ); Object tempObj = this.getClientHelper().create( REPO_SERVICE, null, repoResponseRequest ); // Hack around NEXUS-540 if ( tempObj == null ) { return this.getRepository( repo.getId() ); } // type check the object so we can have a meaninful error if needed this.checkType( tempObj, RepositoryResourceResponse.class ); RepositoryResourceResponse repoResponse = (RepositoryResourceResponse) tempObj; return repoResponse.getData(); }
repoId = resource.getId();
repoId = resource.getId();
CRepository cRepo = getTest().getNexusConfigUtil().getRepo(repo.getId()); M2LayoutedM1ShadowRepositoryConfiguration cShadowRepo = getTest().getNexusConfigUtil().getRepoShadow(repo.getId()); CRepository cRepo = getTest().getNexusConfigUtil().getRepo(repo.getId()); M2RepositoryConfiguration cM2Repo = getTest().getNexusConfigUtil().getM2Repo(repo.getId());
appModel.setId(resource.getId());
appModel.setId( resource.getId() );