SortedSet<Version> versions(String bsn) throws Exception { if (bsn.indexOf(':') > 0) { // // Is a GAV // String[] parts = bsn.split(":"); if (parts.length >= 2) { String classifier = parts.length > 2 ? parts[parts.length - 1] : ""; Program p = Program.valueOf(parts[0], parts[1]); if (p != null) { Set<Version> collect = archives.keySet() .stream() .filter(archive -> archive.revision.program.equals(p) && archive.classifier.equals(classifier)) .map(archive -> archive.revision.version.getOSGiVersion()) .collect(Collectors.toSet()); return new TreeSet<>(collect); } } } // // Non GAVs are left to the bridge // return getBridge().versions(bsn); }
SortedSet<Version> versions(String bsn) throws Exception { if (bsn.indexOf(':') > 0) { // // Is a GAV // String[] parts = bsn.split(":"); if (parts.length >= 2) { String classifier = parts.length > 2 ? parts[parts.length - 1] : ""; Program p = Program.valueOf(parts[0], parts[1]); if (p != null) { Set<Version> collect = archives.keySet() .stream() .filter(archive -> archive.revision.program.equals(p) && archive.classifier.equals(classifier)) .map(archive -> archive.revision.version.getOSGiVersion()) .collect(Collectors.toSet()); return new TreeSet<>(collect); } } } // // Non GAVs are left to the bridge // return getBridge().versions(bsn); }
.filter(v -> v.compareTo(rev) > 0) .collect(groupingBy(v -> { Version ov = v.version.getOSGiVersion(); return new Version(ov.getMajor(), ov.getMinor()); }, maxBy(naturalOrder())))
private Resource info(Archive a, String msg) { ResourceBuilder rb = new ResourceBuilder(); String bsn = a.getWithoutVersion(); MavenVersion version = a.revision.version; BridgeRepository.addInformationCapability(rb, bsn, version.getOSGiVersion(), repo.toString(), msg); return rb.build(); }
.filter(v -> v.compareTo(rev) > 0) .collect(groupingBy(v -> { Version ov = v.version.getOSGiVersion(); return new Version(ov.getMajor(), ov.getMinor()); }, maxBy(naturalOrder())))
private Resource info(Archive a, String msg) { ResourceBuilder rb = new ResourceBuilder(); String bsn = a.getWithoutVersion(); MavenVersion version = a.revision.version; BridgeRepository.addInformationCapability(rb, bsn, version.getOSGiVersion(), repo.toString(), msg); return rb.build(); }
private void parseSingle(Archive archive, File single) throws Exception { ResourceBuilder rb = new ResourceBuilder(); boolean hasIdentity = rb.addFile(single, single.toURI()); if (!hasIdentity) { String name = archive.getWithoutVersion(); MavenVersion version = archive.revision.version; BridgeRepository.addInformationCapability(rb, name, version.getOSGiVersion(), repo.toString(), "Not a bundle"); } Resource resource = rb.build(); put(archive, resource); }
Archive find(String bsn, Version version) throws Exception { // // First try if this is a BSN, not a GAV // String[] parts = bsn.split(":"); if (parts.length == 1) { ResourceInfo info = getBridge().getInfo(bsn, version); if (info == null) return null; Resource resource = info.getResource(); return getArchive(resource); } // // Handle the GAV. Notice that the GAV can also contain extension + // classifier // Archive tmp = Archive.valueOf(bsn + ":" + version); if (tmp == null) return null; return archives.keySet() .stream() .filter(archive -> archive.revision.program.equals(tmp.revision.program) && archive.revision.version.getOSGiVersion() .equals(version) && tmp.classifier.equals(archive.classifier)) .findFirst() .orElse(null); }
private void parseSingle(Archive archive, File single) throws Exception { ResourceBuilder rb = new ResourceBuilder(); boolean hasIdentity = rb.addFile(single, single.toURI()); if (!hasIdentity) { String name = archive.getWithoutVersion(); MavenVersion version = archive.revision.version; BridgeRepository.addInformationCapability(rb, name, version.getOSGiVersion(), repo.toString(), "Not a bundle"); } Resource resource = rb.build(); put(archive, resource); }
Archive find(String bsn, Version version) throws Exception { // // First try if this is a BSN, not a GAV // String[] parts = bsn.split(":"); if (parts.length == 1) { ResourceInfo info = getBridge().getInfo(bsn, version); if (info == null) return null; Resource resource = info.getResource(); return getArchive(resource); } // // Handle the GAV. Notice that the GAV can also contain extension + // classifier // Archive tmp = Archive.valueOf(bsn + ":" + version); if (tmp == null) return null; return archives.keySet() .stream() .filter(archive -> archive.revision.program.equals(tmp.revision.program) && archive.revision.version.getOSGiVersion() .equals(version) && tmp.classifier.equals(archive.classifier)) .findFirst() .orElse(null); }
ResourceBuilder rb = new ResourceBuilder(); String bsn = archive.revision.program.toString(); Version version = toFrameworkVersion(archive.revision.version.getOSGiVersion()); addReserveIdentity(rb, bsn, version); addInformationCapability(rb, archive.toString(), parent, throwable);
ResourceBuilder rb = new ResourceBuilder(); String bsn = archive.revision.program.toString(); Version version = toFrameworkVersion(archive.revision.version.getOSGiVersion()); addReserveIdentity(rb, bsn, version); addInformationCapability(rb, archive.toString(), parent, throwable);
analyzer.setBundleVersion( Version.isVersion( version ) ? Version.parseVersion( version ) : MavenVersion.parseString( version ).getOSGiVersion() ); analyzer.setBundleSymbolicName( name ); analyzer.setImportPackage( importInstructions );
private void parseResource(Archive archive, String parent) throws Exception { ResourceBuilder rb = new ResourceBuilder(); Version frameworkVersion = toFrameworkVersion(archive.revision.version.getOSGiVersion()); String bsn = archive.revision.program.toString(); try { File binary = repo.get(archive) .getValue(); if (!rb.addFile(binary, binary.toURI())) { // no identity addReserveIdentity(rb, bsn, frameworkVersion); } addInformationCapability(rb, archive.toString(), parent); } catch (Exception e) { addReserveIdentity(rb, bsn, frameworkVersion); addInformationCapability(rb, archive.toString(), parent, e); } resources.put(archive, rb.build()); }
private void parseResource(Archive archive, String parent) throws Exception { ResourceBuilder rb = new ResourceBuilder(); Version frameworkVersion = toFrameworkVersion(archive.revision.version.getOSGiVersion()); String bsn = archive.revision.program.toString(); try { File binary = repo.get(archive) .getValue(); if (!rb.addFile(binary, binary.toURI())) { // no identity addReserveIdentity(rb, bsn, frameworkVersion); } addInformationCapability(rb, archive.toString(), parent); } catch (Exception e) { addReserveIdentity(rb, bsn, frameworkVersion); addInformationCapability(rb, archive.toString(), parent, e); } resources.put(archive, rb.build()); }