Exemple #1
0
  public static Version getLatestAvailableVersion(RepositoryConnection cn)
      throws RepositoryException {
    List<Version> allVersions = new ArrayList<Version>();

    RepositoryResult<Statement> res =
        cn.getStatements(MIVVI_DESKTOP_CLIENT, RdfUtil.Doap.release, null, false);

    while (res.hasNext()) {
      Statement stmt = res.next();

      Resource v = RdfUtil.asResource(stmt.getObject());
      if (v != null) {
        String rev = RdfUtil.getStringProperty(cn, v, RdfUtil.Doap.revision);
        if (rev != null) {
          try {
            allVersions.add(Version.parse(rev));
          } catch (ParseException pe) {
            // Ignore this version
          }
        }
      }
    }

    Collections.sort(allVersions);

    if (allVersions.size() > 0) {
      return allVersions.get(allVersions.size() - 1);
    } else {
      return null;
    }
  }
Exemple #2
0
 public static String getDownloadPage(RepositoryConnection cn) throws RepositoryException {
   Resource r = RdfUtil.getResProperty(cn, MIVVI_DESKTOP_CLIENT, DOWNLOAD_PAGE);
   if (r instanceof IRI) {
     return ((IRI) r).toString();
   } else {
     return null;
   }
 }