Package aQute.service.library.Library

Examples of aQute.service.library.Library.Program


      if (f.isFile() && f.length() == r.size)
        sb.format("Cached %s\n", f);
      else
        sb.format("Not downloaded\n");

      Program p = library.getProgram(Library.OSGI_GROUP, bsn);
      if (p != null) {
        RevisionRef update = findUpdate(p, version);
        if (update != null) {
          sb.format(DOWN_ARROW + " This version should be updated to " + update.version);
        }
View Full Code Here


    if (parts.length == 3) {
      bsn = parts[0] + "__" + parts[1];
      classifier = parts[2];
    }

    Program program = library.getProgram(Library.OSGI_GROUP, bsn);
    if (program != null) {
      List<RevisionRef> refs = new ArrayList<Library.RevisionRef>();
      for (RevisionRef r : program.revisions) {
        if (eq(classifier, r.classifier))
          refs.add(r);
View Full Code Here

   *
   * @param bsn
   * @throws Exception
   */
  void update(String bsn) throws Exception {
    Program p = library.getProgram(Library.OSGI_GROUP, bsn);
    for (Version v : index.getVersions(bsn))
      update(p, bsn, v);
  }
View Full Code Here

      return getName();

    if (target.length == 1 && target[0] instanceof String) {
      String bsn = (String) target[0];
      String title = bsn;
      Program p = library.getProgram(Library.OSGI_GROUP, bsn);
      if (p != null) {
        for (Version version : versions(bsn)) {
          RevisionRef findUpdate = findUpdate(p, version);
          if (findUpdate != null)
            title += SUPERIOR_1; // superscript 1
        }
      }
      return title;
    }

    if (target.length == 2 && target[0] instanceof String && target[1] instanceof Version) {
      String bsn = (String) target[0];
      Version version = (Version) target[1];

      Library.RevisionRef resource = index.getRevisionRef(bsn, version);
      if (resource == null)
        return "[deleted " + version + "]";

      String title = getPhase(resource.phase.toString()) + " " + version.toString();

      File path = cache.getPath(bsn, version, resource.revision);
      if (path.isFile() && path.length() == resource.size) {
        title += DOWN_ARROW;
      }
      Program p = library.getProgram(Library.OSGI_GROUP, bsn);
      if (p != null) {
        RevisionRef findUpdate = findUpdate(p, version);
        if (findUpdate != null)
          title += SUPERIOR_1; // superscript 1
      }
View Full Code Here

    IO.delete(root);
    root.mkdirs();
  }

  public Program getProgram(String bsn) {
    Program p = programs.get(bsn);
    if (p != null)
      return p;

    File pf = IO.getFile(programdir, bsn + ".json");
    if (pf != null && pf.isFile() && pf.lastModified() >= refresh.lastModified()) {
View Full Code Here

      refresh = new File(root, "refresh");
      if (!refresh.isFile())
        IO.store(new byte[0], refresh);
    }

    Program p = programCache.get(bsn);
    if (p == null) {
      File f = getLocal(bsn, Version.emptyVersion, null);
      File meta = new File(f.getParentFile(), "program.json");
      if (meta.exists() && meta.lastModified() >= refresh.lastModified()) {
View Full Code Here

      try {

        String bsn = (String) target[0];
        Version version = null;
        if (target.length == 1) {
          Program p = programCache.get(bsn);
          if (p != null) {
            StringBuilder sb = new StringBuilder();
            if (p.wiki != null) {
              sb.append("Description\n").append(p.wiki.text).append("\n");
            }
View Full Code Here

    if (parts.length == 3) {
      bsn = parts[0] + "__" + parts[1];
      classifier = parts[2];
    }

    Program program = getProgram(bsn);
    if (program != null) {
      List<RevisionRef> refs = new ArrayList<Library.RevisionRef>();
      for (RevisionRef r : program.revisions) {
        if (eq(classifier, r.classifier))
          refs.add(r);
View Full Code Here

    if (target.length == 0)
      return getRepositoryActions();

    final String bsn = (String) target[0];
    Program careful = null;

    if (connected)
      try {
        careful = getProgram(bsn, true);
      }
      catch (Exception e) {
        reporter.error("Offline? %s", e);
      }

    final Program p = careful;
    if (target.length == 1)
      return getProgramActions(bsn, p);

    if (target.length >= 2) {
      final Version version = (Version) target[1];
View Full Code Here

      f.close();
    }
  }

  private String programTooltip(String bsn) throws Exception {
    Program p = getProgram(bsn, false);
    if (p != null) {
      Formatter sb = new Formatter();
      try {
        if (p.wiki != null && p.wiki.text != null)
          sb.format("%s\n", p.wiki.text.replaceAll("#\\s?", ""));
View Full Code Here

TOP

Related Classes of aQute.service.library.Library.Program

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.