public static VersionedClause convertRepoBundle(RepositoryBundle bundle) { Attrs attribs = new Attrs(); if (isWorkspaceRepo(bundle.getRepo())) { attribs.put(Constants.VERSION_ATTRIBUTE, VERSION_LATEST); } return new VersionedClause(bundle.getBsn(), attribs); }
Object[] getRepositoryBundleVersions(RepositoryBundle bundle) { RepositoryBundleVersion[] result = null; SortedSet<Version> versions = null; try { versions = bundle.getRepo().versions(bundle.getBsn()); } catch (Exception e) { logger.logError( MessageFormat.format( "Error querying versions for bundle {0} in repository {1}.", bundle.getBsn(), bundle.getRepo().getName()), e); } if (versions != null) { result = new RepositoryBundleVersion[versions.size()]; int i = 0; for (Version version : versions) { result[i++] = new RepositoryBundleVersion(bundle, version); } } return result; }