Package aQute.service.library.Library

Examples of aQute.service.library.Library.Program


    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

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

      Program p = getProgram(bsn, false);
      if (p != null) {

        Runnable update = getUpdateAction(p, r);
        if (update != null) {
          sb.format(DOWN_ARROW + " This version can be updated to " + update);
View Full Code Here

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

    Program program = getProgram(bsn, false);
    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 program = getProgram(bsn, false);
    Runnable updateAction = getUpdateAction(program, bsn);
    if (updateAction == null)
      return;

    reporter.trace("update bsn %s", updateAction);
View Full Code Here

   * @param bsn
   * @return
   * @throws Exception
   */
  private Program getProgram(final String bsn, boolean force) throws Exception {
    Program p = cache.getProgram(bsn);
    if (p == null || force) {
      p = library.getProgram(Library.OSGI_GROUP, bsn);
      if (p != null)
        cache.putProgram(bsn, p);
    }
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

    }

    // We try to learn what is needed so a new project
    // does not have to add them all by hand.

    Program program = library.getProgram(Library.OSGI_GROUP, bsn);
    if (program == null)
      return versions;

    RevisionRef ref = program.revisions.get(0);
View Full Code Here

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

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

    try {
      careful = library.getProgram(Library.OSGI_GROUP, bsn);
    }
    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 = library.getProgram(Library.OSGI_GROUP, bsn);
    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.