Examples of NexusRepositoryTypeListResource


Examples of org.sonatype.nexus.rest.model.NexusRepositoryTypeListResource

    if (templateSet.getTemplatesList().isEmpty()) {
      throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND);
    }

    for (Template template : templateSet.getTemplatesList()) {
      NexusRepositoryTypeListResource resource = new NexusRepositoryTypeListResource();

      String providerRole = ((RepositoryTemplate) template).getRepositoryProviderRole();
      String providerHint = ((RepositoryTemplate) template).getRepositoryProviderHint();

      resource.setProvider(providerHint);

      resource.setProviderRole(providerRole);

      resource.setFormat(((AbstractRepositoryTemplate) template).getContentClass().getId());

      // To not disturb the "New repo UI", it's shitty right now: we select templates here that predefines is
      // something a "release" or "snapshot", but
      // UI allows to select that too.
      resource.setDescription(removeBrackets(template.getDescription()));

      // add it to the collection
      result.addData(resource);
    }
View Full Code Here

Examples of org.sonatype.nexus.rest.model.NexusRepositoryTypeListResource

  @Test
  public void testNexusRepositoryTypeListResourceResponse() {
    NexusRepositoryTypeListResourceResponse response = new NexusRepositoryTypeListResourceResponse();

    NexusRepositoryTypeListResource resource = new NexusRepositoryTypeListResource();
    resource.setDescription("description");
    resource.setFormat("format");
    resource.setProvider("provider");
    resource.setProviderRole("providerRole");

    response.addData(resource);

    NexusRepositoryTypeListResource resource2 = new NexusRepositoryTypeListResource();
    resource2.setDescription("description2");
    resource2.setFormat("format2");
    resource2.setProvider("provider2");
    resource2.setProviderRole("providerRole2");

    response.addData(resource2);

    this.marshalUnmarchalThenCompare(response);
    this.validateXmlHasNoPackageNames(response);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.