use of org.jfrog.build.api.dependency.PatternResultFileSet in project build-info by JFrogDev.
the class AntPatternsDependenciesHelper method performPatternSearch.
private Set<DownloadableArtifact> performPatternSearch(DependencyPattern dependencyPattern) throws IOException {
Set<DownloadableArtifact> downloadableArtifacts = Sets.newHashSet();
String pattern = dependencyPattern.getPattern();
PatternResultFileSet fileSet = downloader.getClient().searchArtifactsByPattern(pattern);
Set<String> filesToDownload = fileSet.getFiles();
log.info("Found " + filesToDownload.size() + " dependencies by doing a pattern search.");
for (String fileToDownload : filesToDownload) {
downloadableArtifacts.add(new DownloadableArtifact(fileSet.getRepoUri(), dependencyPattern.getTargetDirectory(), fileToDownload, dependencyPattern.getMatrixParams(), pattern, dependencyPattern.getPatternType()));
}
return downloadableArtifacts;
}
use of org.jfrog.build.api.dependency.PatternResultFileSet in project build-info by JFrogDev.
the class ArtifactoryDependenciesClient method searchArtifactsByPattern.
public PatternResultFileSet searchArtifactsByPattern(String pattern) throws IOException {
PreemptiveHttpClient client = httpClient.getHttpClient();
String url = artifactoryUrl + "/api/search/pattern?pattern=" + pattern;
PatternResultFileSet result = readResponse(client.execute(new HttpGet(url)), new TypeReference<PatternResultFileSet>() {
}, "Failed to search artifact by the pattern '" + pattern + "'", false);
return result;
}
Aggregations