use of aQute.bnd.service.IndexProvider in project bndtools by bndtools.
the class RepositoryTreeLabelProvider method isRemoteRepo.
private static boolean isRemoteRepo(RepositoryPlugin repository) {
List<?> locations = Collections.emptyList();
if (repository instanceof IndexProvider) {
try {
locations = ((IndexProvider) repository).getIndexLocations();
} catch (Exception e) {
logger.logError("Unable to get repository index list", e);
}
}
for (Object locationObj : locations) {
try {
URI location;
if (locationObj instanceof URI)
location = (URI) locationObj;
else if (locationObj instanceof URL)
location = ((URL) locationObj).toURI();
else
return false;
String protocol = location.getScheme();
if ("http".equals(protocol) || "https".equals(protocol))
return true;
} catch (URISyntaxException e) {
return false;
}
}
return false;
}
use of aQute.bnd.service.IndexProvider in project bndtools by bndtools.
the class RepositoryTreeContentProvider method addRepositoryPlugins.
private void addRepositoryPlugins(Collection<Object> result, Workspace workspace) {
workspace.getErrors().clear();
List<RepositoryPlugin> repoPlugins = workspace.getPlugins(RepositoryPlugin.class);
for (String error : workspace.getErrors()) {
logger.logError(error, null);
}
for (RepositoryPlugin repoPlugin : repoPlugins) {
if (CACHE_REPOSITORY.equals(repoPlugin.getName()))
continue;
if (repoPlugin instanceof IndexProvider) {
IndexProvider indexProvider = (IndexProvider) repoPlugin;
if (!supportsPhase(indexProvider))
continue;
}
if (showRepos)
result.add(repoPlugin);
else
result.addAll(Arrays.asList(getRepositoryBundles(repoPlugin)));
}
}
Aggregations