Examples of RepositoryUrlResource


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

      path = "/" + path;
    }

    List<RepositoryUrlResource> urls = new ArrayList<RepositoryUrlResource>();
    for (String repositoryId : repositories) {
      RepositoryUrlResource repoUrl = new RepositoryUrlResource();

      try {
        protectedRepositoryRegistry.getRepository(repositoryId);
        repoUrl.setCanView(true);
      }
      catch (NoSuchRepositoryAccessException e) {
        // don't have view access, so won't see it!
        repoUrl.setCanView(false);
      }
      catch (NoSuchRepositoryException e) {
        // completely unexpect, probably another thread removed this repo
        getLogger().error(e.getMessage(), e);
        continue;
      }

      repoUrl.setRepositoryId(repositoryId);
      try {
        repoUrl.setRepositoryName(repositoryRegistry.getRepository(repositoryId).getName());
      }
      catch (NoSuchRepositoryException e) {
        // should never happen;
        getLogger().error(e.getMessage(), e);
      }
      repoUrl.setArtifactUrl(referenceFactory.createReference(req,
          "content/repositories/" + repositoryId + path).toString());
      repoUrl.setPath(path);

      urls.add(repoUrl);
    }
    return urls;
  }
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.