use of org.jfrog.build.api.dependency.PropertySearchResult in project build-info by JFrogDev.
the class ArtifactoryDependenciesClient method searchArtifactsByProperties.
public PropertySearchResult searchArtifactsByProperties(String properties) throws IOException {
PreemptiveHttpClient client = httpClient.getHttpClient();
String replacedProperties = StringUtils.replaceEach(properties, new String[] { ";", "+" }, new String[] { "&", "" });
String url = artifactoryUrl + "/api/search/prop?" + replacedProperties;
PropertySearchResult result = readResponse(client.execute(new HttpGet(url)), new TypeReference<PropertySearchResult>() {
}, "Failed to search artifact by the properties '" + properties + "'", false);
return result;
}
use of org.jfrog.build.api.dependency.PropertySearchResult in project build-info by JFrogDev.
the class AntPatternsDependenciesHelper method performPropertySearch.
private Set<DownloadableArtifact> performPropertySearch(DependencyPattern dependencyPattern) throws IOException {
Set<DownloadableArtifact> downloadableArtifacts = Sets.newHashSet();
String pattern = dependencyPattern.getPattern();
String matrixParams = dependencyPattern.getMatrixParams();
PropertySearchResult propertySearchResult = downloader.getClient().searchArtifactsByProperties(matrixParams);
List<PropertySearchResult.SearchEntry> filteredEntries = filterResultEntries(propertySearchResult.getResults(), pattern);
log.info("Found " + filteredEntries.size() + " dependencies by doing a property search.");
for (PropertySearchResult.SearchEntry searchEntry : filteredEntries) {
downloadableArtifacts.add(new DownloadableArtifact(searchEntry.getRepoUri(), dependencyPattern.getTargetDirectory(), searchEntry.getFilePath(), matrixParams, pattern, dependencyPattern.getPatternType()));
}
return downloadableArtifacts;
}
Aggregations