void repoList(List<RepositoryPlugin> repos, String mask) throws Exception { trace("list repo " + repos + " " + mask); Set<String> bsns = new TreeSet<String>(); for (RepositoryPlugin repo : repos) { bsns.addAll(repo.list(mask)); } for (String bsn : bsns) { Set<Version> versions = new TreeSet<Version>(); for (RepositoryPlugin repo : repos) { List<Version> result = repo.versions(bsn); if (result != null) versions.addAll(result); } out.printf("%-40s %s\n", bsn, versions); } }
void repoList(List<RepositoryPlugin> repos, String mask) throws Exception { trace("list repo " + repos + " " + mask); Set<String> bsns = new TreeSet<String>(); for (RepositoryPlugin repo : repos) { bsns.addAll(repo.list(mask)); } for (String bsn : bsns) { Set<Version> versions = new TreeSet<Version>(); for (RepositoryPlugin repo : repos) { List<Version> result = repo.versions(bsn); if (result != null) versions.addAll(result); } out.printf("%-40s %s\n", bsn, versions); } }
public static Element getTree(RepositoryPlugin repo) throws Exception { List<Element> programs = new ArrayList<Element>(); for (String bsn : repo.list(null)) { List<Element> versions = new ArrayList<Element>(); for (Version version : repo.versions(bsn)) { versions.add(new Element(Type.VERSION, version.toString())); } programs.add(new Element(Type.PROGRAM, bsn, versions, Delta.MINOR, Delta.MAJOR, null)); } return new Element(Type.REPO, repo.getName(), programs, Delta.MINOR, Delta.MAJOR, repo.getLocation()); }
public static Element getTree(RepositoryPlugin repo) throws Exception { List<Element> programs = new ArrayList<Element>(); for (String bsn : repo.list(null)) { List<Element> versions = new ArrayList<Element>(); for (Version version : repo.versions(bsn)) { versions.add(new Element(Type.VERSION, version.toString())); } programs.add(new Element(Type.PROGRAM, bsn, versions, Delta.MINOR, Delta.MAJOR, null)); } return new Element(Type.REPO, repo.getName(), programs, Delta.MINOR, Delta.MAJOR, repo.getLocation()); }
public static Element getTree(RepositoryPlugin repo) throws Exception { List<Element> programs = new ArrayList<>(); for (String bsn : repo.list(null)) { List<Element> versions = new ArrayList<>(); for (Version version : repo.versions(bsn)) { versions.add(new Element(Type.VERSION, version.toString())); } programs.add(new Element(Type.PROGRAM, bsn, versions, Delta.MINOR, Delta.MAJOR, null)); } return new Element(Type.REPO, repo.getName(), programs, Delta.MINOR, Delta.MAJOR, repo.getLocation()); }
public static Element getTree(RepositoryPlugin repo) throws Exception { List<Element> programs = new ArrayList<>(); for (String bsn : repo.list(null)) { List<Element> versions = new ArrayList<>(); for (Version version : repo.versions(bsn)) { versions.add(new Element(Type.VERSION, version.toString())); } programs.add(new Element(Type.PROGRAM, bsn, versions, Delta.MINOR, Delta.MAJOR, null)); } return new Element(Type.REPO, repo.getName(), programs, Delta.MINOR, Delta.MAJOR, repo.getLocation()); }
public static Element getTree(RepositoryPlugin repo) throws Exception { List<Element> programs = new ArrayList<Element>(); for (String bsn : repo.list(null)) { List<Element> versions = new ArrayList<Element>(); for (Version version : repo.versions(bsn)) { versions.add(new Element(Type.VERSION, version.toString())); } programs.add(new Element(Type.PROGRAM, bsn, versions, Delta.MINOR, Delta.MAJOR, null)); } return new Element(Type.REPO, repo.getName(), programs, Delta.MINOR, Delta.MAJOR, repo.getLocation()); }
public void copy(RepositoryPlugin source, Instructions filter, RepositoryPlugin destination) throws Exception { assert source != null; assert destination != null; logger.info("copy from repo {} to {} with filter {}", source, destination, filter); for (String bsn : source.list(null)) { for (Version version : source.versions(bsn)) { if (filter == null || filter.matches(bsn)) { logger.info("copy {}:{}", bsn, version); File file = source.get(bsn, version, null); if (file.getName() .endsWith(".jar")) { try (InputStream in = IO.stream(file)) { PutOptions po = new PutOptions(); po.bsn = bsn; po.context = null; po.type = "bundle"; po.version = version; PutResult put = destination.put(in, po); } catch (Exception e) { logger.error("Failed to copy {}-{}", e, bsn, version); error("Failed to copy %s:%s from %s to %s, error: %s", bsn, version, source, destination, e); } } } } } }
public void copy(RepositoryPlugin source, Instructions filter, RepositoryPlugin destination) throws Exception { assert source != null; assert destination != null; logger.info("copy from repo {} to {} with filter {}", source, destination, filter); for (String bsn : source.list(null)) { for (Version version : source.versions(bsn)) { if (filter == null || filter.matches(bsn)) { logger.info("copy {}:{}", bsn, version); File file = source.get(bsn, version, null); if (file.getName() .endsWith(".jar")) { try (InputStream in = IO.stream(file)) { PutOptions po = new PutOptions(); po.bsn = bsn; po.context = null; po.type = "bundle"; po.version = version; PutResult put = destination.put(in, po); } catch (Exception e) { logger.error("Failed to copy {}-{}", e, bsn, version); error("Failed to copy %s:%s from %s to %s, error: %s", bsn, version, source, destination, e); } } } } } }
continue; List<String> bsns = plugin.list(bsnPattern); if (bsns != null) for (String bsn : bsns) {
continue; List<String> bsns = plugin.list(bsnPattern); if (bsns != null) for (String bsn : bsns) {
@Description("List all artifacts from the current repositories with their versions") public void _list(listOptions opts) throws Exception { bnd.trace("list"); Set<String> bsns = new HashSet<String>(); Instruction from = opts.from(); if (from == null) from = new Instruction("*"); for (RepositoryPlugin repo : repos) { if (from.matches(repo.getName())) bsns.addAll(repo.list(opts.query())); } bnd.trace("list " + bsns); for (String bsn : new SortedList<String>(bsns)) { if (!opts.noversions()) { Set<Version> versions = new TreeSet<Version>(); for (RepositoryPlugin repo : repos) { bnd.trace("get " + bsn + " from " + repo); if (from.matches(repo.getName())) { SortedSet<Version> result = repo.versions(bsn); if (result != null) versions.addAll(result); } } bnd.out.printf("%-40s %s%n", bsn, versions); } else { bnd.out.printf("%s%n", bsn); } } }
continue; for (String bsn : repo.list(null)) { revisions.addAll(bsn, repo.versions(bsn));
for (String bsn : source.list(null)) { for (Version version : source.versions(bsn)) { Spec spec = new Spec();