aQute.bnd.osgi.Analyzer.getClasspath()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中aQute.bnd.osgi.Analyzer.getClasspath()方法的一些代码示例,展示了Analyzer.getClasspath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.getClasspath()方法的具体详情如下:
包路径:aQute.bnd.osgi.Analyzer
类名称:Analyzer
方法名:getClasspath

Analyzer.getClasspath介绍

暂无

代码示例

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Locate a resource on the class path.
 * 
 * @param path Path of the reosurce
 * @return A resource or <code>null</code>
 */
public Resource findResource(String path) {
  for (Jar entry : getClasspath()) {
    Resource r = entry.getResource(path);
    if (r != null)
      return r;
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Locate a resource on the class path.
 * 
 * @param path Path of the reosurce
 * @return A resource or <code>null</code>
 */
public Resource findResource(String path) {
  for (Jar entry : getClasspath()) {
    Resource r = entry.getResource(path);
    if (r != null)
      return r;
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Locate a resource on the class path.
 * 
 * @param path
 *            Path of the reosurce
 * @return A resource or <code>null</code>
 */
public Resource findResource(String path) {
  for (Jar entry : getClasspath()) {
    Resource r = entry.getResource(path);
    if (r != null)
      return r;
  }
  return null;
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Locate a resource on the class path.
 * 
 * @param path
 *            Path of the reosurce
 * @return A resource or <code>null</code>
 */
public Resource findResource(String path) {
  for (Jar entry : getClasspath()) {
    Resource r = entry.getResource(path);
    if (r != null)
      return r;
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Locate a resource on the class path.
 * 
 * @param path
 *            Path of the reosurce
 * @return A resource or <code>null</code>
 */
public Resource findResource(String path) {
  for (Jar entry : getClasspath()) {
    Resource r = entry.getResource(path);
    if (r != null)
      return r;
  }
  return null;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

public List<Jar> getJarsFromName(String name, String from) {
  Jar j = super.getJarFromName(name, from);
  if (j != null)
    return Collections.singletonList(j);
  Glob g = new Glob(name);
  List<Jar> result = new ArrayList<>();
  for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) {
    Jar entry = cp.next();
    if (entry.getSource() == null)
      continue;
    if (g.matcher(entry.getSource()
      .getName())
      .matches()) {
      result.add(entry);
    }
  }
  return result;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Try to get a Jar from a file name/path or a url, or in last resort from
 * the classpath name part of their files.
 * 
 * @param name
 *            URL or filename relative to the base
 * @param from
 *            Message identifying the caller for errors
 * @return null or a Jar with the contents for the name
 */
public Jar getJarFromName(String name, String from) {
  Jar j = super.getJarFromName(name, from);
  if (j == null) {
    for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) {
      Jar entry = cp.next();
      if (entry.getSource() != null && entry.getSource().getName().equals(name)) {
        return entry;
      }
    }
  }
  return j;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

out.printf("Current directory            : %s%n", new File("").getAbsolutePath());
out.println("Classpath used");
for (Jar jar : getClasspath()) {
  out.printf("File                                : %s%n", jar.getSource());
  out.printf("File abs path                       : %s%n", jar.getSource()

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Try to get a Jar from a file name/path or a url, or in last resort from
 * the classpath name part of their files.
 * 
 * @param name
 *            URL or filename relative to the base
 * @param from
 *            Message identifying the caller for errors
 * @return null or a Jar with the contents for the name
 */
public Jar getJarFromName(String name, String from) {
  Jar j = super.getJarFromName(name, from);
  if (j == null) {
    for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) {
      Jar entry = cp.next();
      if (entry.getSource() != null && entry.getSource().getName().equals(name)) {
        return entry;
      }
    }
  }
  return j;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public List<Jar> getJarsFromName(String name, String from) {
  Jar j = super.getJarFromName(name, from);
  if (j != null)
    return Collections.singletonList(j);
  Glob g = new Glob(name);
  List<Jar> result = new ArrayList<>();
  for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) {
    Jar entry = cp.next();
    if (entry.getSource() == null)
      continue;
    if (g.matcher(entry.getSource()
      .getName())
      .matches()) {
      result.add(entry);
    }
  }
  return result;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

out.printf("Current directory            : %s%n", new File("").getAbsolutePath());
out.println("Classpath used");
for (Jar jar : getClasspath()) {
  out.printf("File                                : %s%n", jar.getSource());
  out.printf("File abs path                       : %s%n", jar.getSource().getAbsolutePath());

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

out.printf("Current directory            : %s%n", new File("").getAbsolutePath());
out.println("Classpath used");
for (Jar jar : getClasspath()) {
  out.printf("File                                : %s%n", jar.getSource());
  out.printf("File abs path                       : %s%n", jar.getSource()

代码示例来源:origin: biz.aQute.bnd/bnd

out.printf("Current directory            : %s%n", new File("").getAbsolutePath());
out.println("Classpath used");
for (Jar jar : getClasspath()) {
  out.printf("File                                : %s%n", jar.getSource());
  out.printf("File abs path                       : %s%n", jar.getSource().getAbsolutePath());

代码示例来源:origin: biz.aQute/bndlib

out.printf("Current directory            : %s%n", new File("").getAbsolutePath());
out.println("Classpath used");
for (Jar jar : getClasspath()) {
  out.printf("File                                : %s%n", jar.getSource());
  out.printf("File abs path                       : %s%n", jar.getSource().getAbsolutePath());

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Try to get a Jar from a file name/path or a url, or in last resort from
 * the classpath name part of their files.
 * 
 * @param name URL or filename relative to the base
 * @param from Message identifying the caller for errors
 * @return null or a Jar with the contents for the name
 */
@Override
public Jar getJarFromName(String name, String from) {
  Jar j = super.getJarFromName(name, from);
  Glob g = new Glob(name);
  if (j == null) {
    for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) {
      Jar entry = cp.next();
      if (entry.getSource() == null)
        continue;
      if (g.matcher(entry.getSource()
        .getName())
        .matches()) {
        return entry;
      }
    }
  }
  return j;
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Try to get a Jar from a file name/path or a url, or in last resort from
 * the classpath name part of their files.
 * 
 * @param name URL or filename relative to the base
 * @param from Message identifying the caller for errors
 * @return null or a Jar with the contents for the name
 */
@Override
public Jar getJarFromName(String name, String from) {
  Jar j = super.getJarFromName(name, from);
  Glob g = new Glob(name);
  if (j == null) {
    for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) {
      Jar entry = cp.next();
      if (entry.getSource() == null)
        continue;
      if (g.matcher(entry.getSource()
        .getName())
        .matches()) {
        return entry;
      }
    }
  }
  return j;
}

代码示例来源:origin: biz.aQute/bndlib

for (Iterator<Jar> cp = getClasspath().iterator(); cp.hasNext();) {
  Jar entry = cp.next();
  if (entry.getSource() != null && entry.getSource().getName().equals(name)) {

代码示例来源:origin: org.wisdom-framework/wisdom-ipojo-module

private String getRange(Analyzer analyzer) throws Exception {
  if (foundRange != null) {
    return foundRange;
  }
  if (Strings.isNullOrEmpty(value)) {
    for (Jar jar : analyzer.getClasspath()) {
      if (isProvidedByJar(jar) && jar.getVersion() != null) {
        foundRange = jar.getVersion();
        return jar.getVersion();
      }
    }
    // Cannot find a provider.
    reporter.error("Cannot find a dependency providing " + name + " in the classpath");
    return null;
  } else {
    return value;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

for (Jar jar : getClasspath())
  try {
    if (bsn.equals(jar.getBsn())) {

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

for (Jar jar : getClasspath())
  try {
    if (bsn.equals(jar.getBsn())) {

相关文章

Analyzer类方法