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

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

本文整理了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

  1. public void stripSignatures() {
  2. Map<String, Resource> map = getDirectories().get("META-INF");
  3. if (map != null) {
  4. for (String file : new HashSet<>(map.keySet())) {
  5. if (SIGNER_FILES_P.matcher(file)
  6. .matches())
  7. remove(file);
  8. }
  9. }
  10. }

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

  1. public void stripSignatures() {
  2. Map<String, Resource> map = getDirectories().get("META-INF");
  3. if (map != null) {
  4. for (String file : new HashSet<>(map.keySet())) {
  5. if (SIGNER_FILES_P.matcher(file)
  6. .matches())
  7. remove(file);
  8. }
  9. }
  10. }

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

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

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

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

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

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

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

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

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

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

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

  1. /**
  2. * Get the exporter of a package ...
  3. */
  4. public String _exporters(String args[]) throws Exception {
  5. Macro.verifyCommand(args, "${exporters;<packagename>}, returns the list of jars that export the given package",
  6. null, 2, 2);
  7. StringBuilder sb = new StringBuilder();
  8. String del = "";
  9. String pack = args[1].replace('.', '/');
  10. for (Jar jar : classpath) {
  11. if (jar.getDirectories()
  12. .containsKey(pack)) {
  13. sb.append(del);
  14. sb.append(jar.getName());
  15. }
  16. }
  17. return sb.toString();
  18. }

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

  1. /**
  2. * Get the exporter of a package ...
  3. */
  4. public String _exporters(String args[]) throws Exception {
  5. Macro.verifyCommand(args, "${exporters;<packagename>}, returns the list of jars that export the given package",
  6. null, 2, 2);
  7. StringBuilder sb = new StringBuilder();
  8. String del = "";
  9. String pack = args[1].replace('.', '/');
  10. for (Jar jar : classpath) {
  11. if (jar.getDirectories()
  12. .containsKey(pack)) {
  13. sb.append(del);
  14. sb.append(jar.getName());
  15. }
  16. }
  17. return sb.toString();
  18. }

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

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

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

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

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

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

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

  1. public boolean analyzeJar(Analyzer analyzer) throws Exception {
  2. Jar jar = analyzer.getJar();
  3. Map<String,Resource> dir = jar.getDirectories().get(root);
  4. if (dir == null || dir.isEmpty()) {
  5. Resource resource = jar.getResource(root);
  6. if (resource != null)
  7. process(analyzer, root, resource);
  8. return false;
  9. }
  10. for (Iterator<Map.Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
  11. Map.Entry<String,Resource> entry = i.next();
  12. String path = entry.getKey();
  13. Resource resource = entry.getValue();
  14. if (paths.matcher(path).matches()) {
  15. process(analyzer, path, resource);
  16. }
  17. }
  18. return false;
  19. }

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

  1. public boolean analyzeJar(Analyzer analyzer) throws Exception {
  2. Jar jar = analyzer.getJar();
  3. Map<String,Resource> dir = jar.getDirectories().get(root);
  4. if (dir == null || dir.isEmpty()) {
  5. Resource resource = jar.getResource(root);
  6. if (resource != null)
  7. process(analyzer, root, resource);
  8. return false;
  9. }
  10. for (Iterator<Map.Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
  11. Map.Entry<String,Resource> entry = i.next();
  12. String path = entry.getKey();
  13. Resource resource = entry.getValue();
  14. if (paths.matcher(path).matches()) {
  15. process(analyzer, path, resource);
  16. }
  17. }
  18. return false;
  19. }

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

  1. public boolean analyzeJar(Analyzer analyzer) throws Exception {
  2. Jar jar = analyzer.getJar();
  3. Map<String,Resource> dir = jar.getDirectories().get(root);
  4. if (dir == null || dir.isEmpty()) {
  5. Resource resource = jar.getResource(root);
  6. if (resource != null)
  7. process(analyzer, root, resource);
  8. return false;
  9. }
  10. for (Iterator<Map.Entry<String,Resource>> i = dir.entrySet().iterator(); i.hasNext();) {
  11. Map.Entry<String,Resource> entry = i.next();
  12. String path = entry.getKey();
  13. Resource resource = entry.getValue();
  14. if (paths.matcher(path).matches()) {
  15. process(analyzer, path, resource);
  16. }
  17. }
  18. return false;
  19. }

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

  1. public boolean analyzeJar(Analyzer analyzer) throws Exception {
  2. Jar jar = analyzer.getJar();
  3. Map<String, Resource> dir = jar.getDirectories()
  4. .get(root);
  5. if (dir == null || dir.isEmpty()) {
  6. Resource resource = jar.getResource(root);
  7. if (resource != null)
  8. process(analyzer, root, resource);
  9. return false;
  10. }
  11. for (Iterator<Map.Entry<String, Resource>> i = dir.entrySet()
  12. .iterator(); i.hasNext();) {
  13. Map.Entry<String, Resource> entry = i.next();
  14. String path = entry.getKey();
  15. Resource resource = entry.getValue();
  16. if (paths.matcher(path)
  17. .matches()) {
  18. process(analyzer, path, resource);
  19. }
  20. }
  21. return false;
  22. }

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

  1. public void verifyBundleClasspath() {
  2. Parameters bcp = main.getBundleClassPath();
  3. if (bcp.isEmpty() || bcp.containsKey("."))
  4. return;
  5. for (String path : bcp.keySet()) {
  6. if (path.endsWith("/"))
  7. error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path);
  8. if (dot.getDirectories().containsKey(path))
  9. // We assume that any classes are in a directory
  10. // and therefore do not care when the bundle is included
  11. return;
  12. }
  13. for (String path : dot.getResources().keySet()) {
  14. if (path.endsWith(".class")) {
  15. 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?");
  16. return;
  17. }
  18. }
  19. }

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

  1. public void verifyBundleClasspath() {
  2. Parameters bcp = main.getBundleClassPath();
  3. if (bcp.isEmpty() || bcp.containsKey("."))
  4. return;
  5. for (String path : bcp.keySet()) {
  6. if (path.endsWith("/"))
  7. error("A Bundle-ClassPath entry must not end with '/': %s", path);
  8. if (dot.getDirectories().containsKey(path))
  9. // We assume that any classes are in a directory
  10. // and therefore do not care when the bundle is included
  11. return;
  12. }
  13. for (String path : dot.getResources().keySet()) {
  14. if (path.endsWith(".class")) {
  15. 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?");
  16. return;
  17. }
  18. }
  19. }

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

  1. public void verifyBundleClasspath() {
  2. Parameters bcp = main.getBundleClassPath();
  3. if (bcp.isEmpty() || bcp.containsKey("."))
  4. return;
  5. for (String path : bcp.keySet()) {
  6. if (path.endsWith("/"))
  7. error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path);
  8. if (dot.getDirectories()
  9. .containsKey(path))
  10. // We assume that any classes are in a directory
  11. // and therefore do not care when the bundle is included
  12. return;
  13. }
  14. for (String path : dot.getResources()
  15. .keySet()) {
  16. if (path.endsWith(".class")) {
  17. warning("The " + Constants.BUNDLE_CLASSPATH
  18. + " does not contain the actual bundle JAR (as specified with '.' in the "
  19. + Constants.BUNDLE_CLASSPATH + ") but the JAR does contain classes. Is this intentional?");
  20. return;
  21. }
  22. }
  23. }

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

  1. public void verifyBundleClasspath() {
  2. Parameters bcp = main.getBundleClassPath();
  3. if (bcp.isEmpty() || bcp.containsKey("."))
  4. return;
  5. for (String path : bcp.keySet()) {
  6. if (path.endsWith("/"))
  7. error("A " + Constants.BUNDLE_CLASSPATH + " entry must not end with '/': %s", path);
  8. if (dot.getDirectories().containsKey(path))
  9. // We assume that any classes are in a directory
  10. // and therefore do not care when the bundle is included
  11. return;
  12. }
  13. for (String path : dot.getResources().keySet()) {
  14. if (path.endsWith(".class")) {
  15. 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?");
  16. return;
  17. }
  18. }
  19. }

相关文章