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); }
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); }
String tooltip(Object[] target) throws Exception { String tooltip = getBridge().tooltip(target); switch (target.length) { case 2 : ResourceInfo info = getBridge().getInfo((String) target[0], (Version) target[1]); Archive archive = getArchive(info.getResource()); if (archive != null) { tooltip += "Coordinates: " + archive + "\n"; } } return tooltip; }
String tooltip(Object[] target) throws Exception { String tooltip = getBridge().tooltip(target); switch (target.length) { case 2 : ResourceInfo info = getBridge().getInfo((String) target[0], (Version) target[1]); Archive archive = getArchive(info.getResource()); if (archive != null) { tooltip += "Coordinates: " + archive + "\n"; } } return tooltip; }