Ejemplo n.º 1
0
 private List<MavenVersion> getAllVersions(RepoResponse repoResponse) {
   List<MavenVersion> versions;
   NexusResponseHandler nexusReponseHandler = new NexusResponseHandler(repoResponse);
   if (nexusReponseHandler.canHandle()) {
     versions = nexusReponseHandler.getAllVersions();
   } else {
     LOGGER.warn("Returning empty version list - no XML nor HTML Nexus answer found");
     versions = Collections.emptyList();
   }
   return versions;
 }
Ejemplo n.º 2
0
 Files getFiles(MavenVersion version) {
   RepoResponse repoResponse =
       repositoryConnector.makeFilesRequest(lookupParams, version.getV_Q());
   LOGGER.debug(repoResponse.responseBody);
   NexusResponseHandler nexusReponseHandler = new NexusResponseHandler(repoResponse);
   List<String> files;
   String pomFile = null;
   if (nexusReponseHandler.canHandle()) {
     files = nexusReponseHandler.getFilesMatching(lookupParams.getArtifactSelectionPattern());
     pomFile = nexusReponseHandler.getPOMurl();
     LOGGER.info("pomFile is " + pomFile);
   } else {
     LOGGER.warn("Returning empty version list - no XML nor HTML Nexus answer found");
     files = Collections.emptyList();
   }
   LOGGER.info("Files: " + files);
   return files.size() > 0
       ? new Files(
           repositoryConnector.getFilesUrlWithBasicAuth(lookupParams, version.getV_Q()),
           files.get(0),
           repositoryConnector.getFilesUrl(lookupParams, version.getV_Q()) + pomFile,
           lookupParams)
       : null;
 }