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

x33g5p2x  于2022-01-22 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(164)

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

Jar.getDirectories介绍

暂无

代码示例

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

public void stripSignatures() {
  Map<String, Resource> map = getDirectories().get("META-INF");
  if (map != null) {
    for (String file : new HashSet<>(map.keySet())) {
      if (SIGNER_FILES_P.matcher(file)
        .matches())
        remove(file);
    }
  }
}

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

public void stripSignatures() {
  Map<String, Resource> map = getDirectories().get("META-INF");
  if (map != null) {
    for (String file : new HashSet<>(map.keySet())) {
      if (SIGNER_FILES_P.matcher(file)
        .matches())
        remove(file);
    }
  }
}

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

public void copy(Jar srce, String path, boolean overwrite) {
  check();
  addDirectory(srce.getDirectories()
    .get(path), overwrite);
}

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

public void copy(Jar srce, String path, boolean overwrite) {
  check();
  addDirectory(srce.getDirectories()
    .get(path), overwrite);
}

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

/**
 * Get the exporter of a package ...
 */
public String _exporters(String args[]) throws Exception {
  Macro.verifyCommand(args, "${exporters;<packagename>}, returns the list of jars that export the given package",
      null, 2, 2);
  StringBuilder sb = new StringBuilder();
  String del = "";
  String pack = args[1].replace('.', '/');
  for (Jar jar : classpath) {
    if (jar.getDirectories().containsKey(pack)) {
      sb.append(del);
      sb.append(jar.getName());
    }
  }
  return sb.toString();
}

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

/**
 * Get the exporter of a package ...
 */
public String _exporters(String args[]) throws Exception {
  Macro.verifyCommand(args, "${exporters;<packagename>}, returns the list of jars that export the given package",
      null, 2, 2);
  StringBuilder sb = new StringBuilder();
  String del = "";
  String pack = args[1].replace('.', '/');
  for (Jar jar : classpath) {
    if (jar.getDirectories().containsKey(pack)) {
      sb.append(del);
      sb.append(jar.getName());
    }
  }
  return sb.toString();
}

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

/**
 * Get the exporter of a package ...
 */
public String _exporters(String args[]) throws Exception {
  Macro.verifyCommand(args, "${exporters;<packagename>}, returns the list of jars that export the given package",
      null, 2, 2);
  StringBuilder sb = new StringBuilder();
  String del = "";
  String pack = args[1].replace('.', '/');
  for (Jar jar : classpath) {
    if (jar.getDirectories().containsKey(pack)) {
      sb.append(del);
      sb.append(jar.getName());
    }
  }
  return sb.toString();
}

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

/**
 * Get the exporter of a package ...
 */
public String _exporters(String args[]) throws Exception {
  Macro.verifyCommand(args, "${exporters;<packagename>}, returns the list of jars that export the given package",
    null, 2, 2);
  StringBuilder sb = new StringBuilder();
  String del = "";
  String pack = args[1].replace('.', '/');
  for (Jar jar : classpath) {
    if (jar.getDirectories()
      .containsKey(pack)) {
      sb.append(del);
      sb.append(jar.getName());
    }
  }
  return sb.toString();
}

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

/**
 * Get the exporter of a package ...
 */
public String _exporters(String args[]) throws Exception {
  Macro.verifyCommand(args, "${exporters;<packagename>}, returns the list of jars that export the given package",
    null, 2, 2);
  StringBuilder sb = new StringBuilder();
  String del = "";
  String pack = args[1].replace('.', '/');
  for (Jar jar : classpath) {
    if (jar.getDirectories()
      .containsKey(pack)) {
      sb.append(del);
      sb.append(jar.getName());
    }
  }
  return sb.toString();
}

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

public void copy(Jar srce, String path, boolean overwrite) {
  check();
  addDirectory(srce.getDirectories().get(path), overwrite);
}

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

public void copy(Jar srce, String path, boolean overwrite) {
  check();
  addDirectory(srce.getDirectories().get(path), overwrite);
}

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

public void copy(Jar srce, String path, boolean overwrite) {
  check();
  addDirectory(srce.getDirectories().get(path), overwrite);
}

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

public boolean analyzeJar(Analyzer analyzer) throws Exception {
  Jar jar = analyzer.getJar();
  Map<String,Resource> dir = jar.getDirectories().get(root);
  if (dir == null || dir.isEmpty()) {
    Resource resource = jar.getResource(root);
    if (resource != null)
      process(analyzer, root, resource);
    return false;
  }
  for (Iterator<Map.Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
    Map.Entry<String,Resource> entry = i.next();
    String path = entry.getKey();
    Resource resource = entry.getValue();
    if (paths.matcher(path).matches()) {
      process(analyzer, path, resource);
    }
  }
  return false;
}

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

public boolean analyzeJar(Analyzer analyzer) throws Exception {
  Jar jar = analyzer.getJar();
  Map<String,Resource> dir = jar.getDirectories().get(root);
  if (dir == null || dir.isEmpty()) {
    Resource resource = jar.getResource(root);
    if (resource != null)
      process(analyzer, root, resource);
    return false;
  }
  for (Iterator<Map.Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
    Map.Entry<String,Resource> entry = i.next();
    String path = entry.getKey();
    Resource resource = entry.getValue();
    if (paths.matcher(path).matches()) {
      process(analyzer, path, resource);
    }
  }
  return false;
}

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

public boolean analyzeJar(Analyzer analyzer) throws Exception {
  Jar jar = analyzer.getJar();
  Map<String,Resource> dir = jar.getDirectories().get(root);
  if (dir == null || dir.isEmpty()) {
    Resource resource = jar.getResource(root);
    if (resource != null)
      process(analyzer, root, resource);
    return false;
  }
  for (Iterator<Map.Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
    Map.Entry<String,Resource> entry = i.next();
    String path = entry.getKey();
    Resource resource = entry.getValue();
    if (paths.matcher(path).matches()) {
      process(analyzer, path, resource);
    }
  }
  return false;
}

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

public boolean analyzeJar(Analyzer analyzer) throws Exception {
  Jar jar = analyzer.getJar();
  Map<String, Resource> dir = jar.getDirectories()
    .get(root);
  if (dir == null || dir.isEmpty()) {
    Resource resource = jar.getResource(root);
    if (resource != null)
      process(analyzer, root, resource);
    return false;
  }
  for (Iterator<Map.Entry<String, Resource>> i = dir.entrySet()
    .iterator(); i.hasNext();) {
    Map.Entry<String, Resource> entry = i.next();
    String path = entry.getKey();
    Resource resource = entry.getValue();
    if (paths.matcher(path)
      .matches()) {
      process(analyzer, path, resource);
    }
  }
  return false;
}

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

public void verifyBundleClasspath() {
  Parameters bcp = main.getBundleClassPath();
  if (bcp.isEmpty() || bcp.containsKey("."))
    return;
  for (String path : bcp.keySet()) {
    if (path.endsWith("/"))
      error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path);
    if (dot.getDirectories().containsKey(path))
      // We assume that any classes are in a directory
      // and therefore do not care when the bundle is included
      return;
  }
  for (String path : dot.getResources().keySet()) {
    if (path.endsWith(".class")) {
      warning("The " + Constants.BUNDLE_CLASSPATH + " does not contain the actual bundle JAR (as specified with '.' in the " + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?");
      return;
    }
  }
}

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

public void verifyBundleClasspath() {
  Parameters bcp = main.getBundleClassPath();
  if (bcp.isEmpty() || bcp.containsKey("."))
    return;
  for (String path : bcp.keySet()) {
    if (path.endsWith("/"))
      error("A Bundle-ClassPath entry must not end with '/': %s", path);
    if (dot.getDirectories().containsKey(path))
      // We assume that any classes are in a directory
      // and therefore do not care when the bundle is included
      return;
  }
  for (String path : dot.getResources().keySet()) {
    if (path.endsWith(".class")) {
      warning("The Bundle-Classpath does not contain the actual bundle JAR (as specified with '.' in the Bundle-Classpath) but the JAR does contain classes. Is this intentional?");
      return;
    }
  }
}

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

public void verifyBundleClasspath() {
  Parameters bcp = main.getBundleClassPath();
  if (bcp.isEmpty() || bcp.containsKey("."))
    return;
  for (String path : bcp.keySet()) {
    if (path.endsWith("/"))
      error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path);
    if (dot.getDirectories()
      .containsKey(path))
      // We assume that any classes are in a directory
      // and therefore do not care when the bundle is included
      return;
  }
  for (String path : dot.getResources()
    .keySet()) {
    if (path.endsWith(".class")) {
      warning("The " + Constants.BUNDLE_CLASSPATH
        + " does not contain the actual bundle JAR (as specified with '.' in the "
        + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?");
      return;
    }
  }
}

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

public void verifyBundleClasspath() {
  Parameters bcp = main.getBundleClassPath();
  if (bcp.isEmpty() || bcp.containsKey("."))
    return;
  for (String path : bcp.keySet()) {
    if (path.endsWith("/"))
      error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path);
    if (dot.getDirectories().containsKey(path))
      // We assume that any classes are in a directory
      // and therefore do not care when the bundle is included
      return;
  }
  for (String path : dot.getResources().keySet()) {
    if (path.endsWith(".class")) {
      warning("The " + Constants.BUNDLE_CLASSPATH + " does not contain the actual bundle JAR (as specified with '.' in the " + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?");
      return;
    }
  }
}

相关文章

微信公众号

最新文章

更多