Package aQute.bnd.osgi

Examples of aQute.bnd.osgi.Domain


            if ((options & IMPEXP) != 0) {
                out.println("[IMPEXP]");
                Manifest m = jar.getManifest();

                if (m != null) {
                    Domain domain = Domain.domain(m);
                    Parameters imports = domain.getImportPackage();
                    Parameters exports = domain.getExportPackage();
                    for (String p : exports.keySet()) {
                        if (imports.containsKey(p)) {
                            Attrs attrs = imports.get(p);
                            if (attrs.containsKey(VERSION_ATTRIBUTE)) {
                                exports.get(p).put("imported-as", attrs.get(VERSION_ATTRIBUTE));
View Full Code Here


            Manifest manifest = jarStream.getManifest();
            if (manifest == null) {
                return null;
            }

            Domain domain = Domain.domain(manifest);
            Entry<String, Attrs> bsnAttrs = domain.getBundleSymbolicName();
            if (bsnAttrs == null) {
                return null;
            }
            String bsn = bsnAttrs.getKey();
            String version = domain.getBundleVersion();

            if (version == null) {
                version = props.get("version");
            }
View Full Code Here

            if ((options & IMPEXP) != 0) {
                out.println("[IMPEXP]");
                Manifest m = jar.getManifest();

                if (m != null) {
                    Domain domain = Domain.domain(m);
                    Parameters imports = domain.getImportPackage();
                    Parameters exports = domain.getExportPackage();
                    for (String p : exports.keySet()) {
                        if (imports.containsKey(p)) {
                            Attrs attrs = imports.get(p);
                            if (attrs.containsKey(VERSION_ATTRIBUTE)) {
                                exports.get(p).put("imported-as", attrs.get(VERSION_ATTRIBUTE));
View Full Code Here

            Manifest manifest = jarStream.getManifest();
            if (manifest == null) {
                return null;
            }

            Domain domain = Domain.domain(manifest);
            Entry<String, Attrs> bsnAttrs = domain.getBundleSymbolicName();
            if (bsnAttrs == null) {
                return null;
            }
            String bsn = bsnAttrs.getKey();
            String version = domain.getBundleVersion();

            for (RepositoryPlugin repo : RepositoryUtils.listRepositories(true)) {
                if (repo == null) {
                    continue;
                }
View Full Code Here

   * @param jar the jar
   * @return the Jar name as it appears in the Repository e.g. bndtools.release-1.0.0.jar
   */
  public static String getJarFileName(Jar jar) {
    try {
        Domain domain = Domain.domain(jar.getManifest());
      return domain.getBundleSymbolicName().getKey() + '-' + stripVersionQualifier(domain.getBundleVersion()) + ".jar";
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    return sb.toString();
  }

  public static String getBundleSymbolicName(Jar jar) {
    try {
        Domain domain = Domain.domain(jar.getManifest());
        return domain.getBundleSymbolicName().getKey();
    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    }
  }

  public static String getBundleVersion(Jar jar) {
    try {
            Domain domain = Domain.domain(jar.getManifest());
            return domain.getBundleVersion();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

        out.println();
      }
      if ((options & IMPEXP) != 0) {
        out.println("[IMPEXP]");
        Manifest m = jar.getManifest();
        Domain domain = Domain.domain(m);

        if (m != null) {
          Parameters imports = domain.getImportPackage();
          Parameters exports = domain.getExportPackage();
          for (String p : exports.keySet()) {
            if (imports.containsKey(p)) {
              Attrs attrs = imports.get(p);
              if (attrs.containsKey(VERSION_ATTRIBUTE)) {
                exports.get(p).put("imported-as", attrs.get(VERSION_ATTRIBUTE));
View Full Code Here

      if (jar == null) {
        err.println("no file " + s);
        continue;
      }

      Domain domain = Domain.domain(jar.getManifest());
      Hashtable<String,Object> ht = new Hashtable<String,Object>();
      Iterator<String> i = domain.iterator();
      Set<String> realNames = new HashSet<String>();

      while (i.hasNext()) {
        String key = i.next();
        String value = domain.get(key).trim();
        ht.put(key.trim().toLowerCase(), value);
        realNames.add(key);
      }
      ht.put("resources", jar.getResources().keySet());
      realNames.add("resources");
View Full Code Here

      trace("find %s", f);
      Jar jar = new Jar(f);
      try {
        Manifest m = jar.getManifest();
        if (m != null) {
          Domain domain = Domain.domain(m);

          if (options.exports() != null) {
            Parameters ep = domain.getExportPackage();
            for (Glob g : options.exports()) {
              for (Entry<String,Attrs> exp : ep.entrySet()) {
                if (g.matcher(exp.getKey()).matches()) {
                  String v = exp.getValue().get(VERSION_ATTRIBUTE);
                  if (v == null)
                    v = "0";
                  out.printf(">%s: %s-%s%n", f.getPath(), exp.getKey(), v);
                }
              }
            }
          }
          if (options.imports() != null) {
            Parameters ip = domain.getImportPackage();
            for (Glob g : options.imports()) {
              for (Entry<String,Attrs> imp : ip.entrySet()) {
                if (g.matcher(imp.getKey()).matches()) {
                  String v = imp.getValue().get(VERSION_ATTRIBUTE);
                  if (v == null)
View Full Code Here

TOP

Related Classes of aQute.bnd.osgi.Domain

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.