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

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

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

Jar.getDirectory介绍

暂无

代码示例

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

  1. public Resource remove(String path) {
  2. check();
  3. Resource resource = resources.remove(path);
  4. if (resource != null) {
  5. String dir = getDirectory(path);
  6. Map<String, Resource> mdir = directories.get(dir);
  7. // must be != null
  8. mdir.remove(path);
  9. }
  10. return resource;
  11. }

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

  1. public Resource remove(String path) {
  2. check();
  3. Resource resource = resources.remove(path);
  4. String dir = getDirectory(path);
  5. Map<String,Resource> mdir = directories.get(dir);
  6. // must be != null
  7. mdir.remove(path);
  8. return resource;
  9. }

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

  1. public Resource remove(String path) {
  2. check();
  3. Resource resource = resources.remove(path);
  4. if (resource != null) {
  5. String dir = getDirectory(path);
  6. Map<String, Resource> mdir = directories.get(dir);
  7. // must be != null
  8. mdir.remove(path);
  9. }
  10. return resource;
  11. }

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

  1. public Resource remove(String path) {
  2. check();
  3. Resource resource = resources.remove(path);
  4. String dir = getDirectory(path);
  5. Map<String,Resource> mdir = directories.get(dir);
  6. // must be != null
  7. mdir.remove(path);
  8. return resource;
  9. }

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

  1. public Resource remove(String path) {
  2. check();
  3. Resource resource = resources.remove(path);
  4. String dir = getDirectory(path);
  5. Map<String,Resource> mdir = directories.get(dir);
  6. // must be != null
  7. mdir.remove(path);
  8. return resource;
  9. }

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

  1. manifestFirst = true;
  2. String dir = getDirectory(path);
  3. Map<String,Resource> s = directories.get(dir);
  4. if (s == null) {

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

  1. manifestFirst = true;
  2. String dir = getDirectory(path);
  3. Map<String,Resource> s = directories.get(dir);
  4. if (s == null) {

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

  1. manifestFirst = true;
  2. String dir = getDirectory(path);
  3. Map<String,Resource> s = directories.get(dir);
  4. if (s == null) {

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

  1. public boolean putResource(String path, Resource resource, boolean overwrite) {
  2. check();
  3. updateModified(resource.lastModified(), path);
  4. while (path.startsWith("/"))
  5. path = path.substring(1);
  6. if (path.equals(manifestName)) {
  7. manifest = null;
  8. if (resources.isEmpty())
  9. manifestFirst = true;
  10. }
  11. Map<String, Resource> s = directories.computeIfAbsent(getDirectory(path), dir -> {
  12. // make ancestor directories
  13. for (int n = dir.lastIndexOf('/'); n > 0; n = dir.lastIndexOf('/')) {
  14. dir = dir.substring(0, n);
  15. if (directories.containsKey(dir))
  16. break;
  17. directories.put(dir, null);
  18. }
  19. return new TreeMap<>();
  20. });
  21. boolean duplicate = s.containsKey(path);
  22. if (!duplicate || overwrite) {
  23. resources.put(path, resource);
  24. s.put(path, resource);
  25. }
  26. return duplicate;
  27. }

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

  1. public boolean putResource(String path, Resource resource, boolean overwrite) {
  2. check();
  3. updateModified(resource.lastModified(), path);
  4. while (path.startsWith("/"))
  5. path = path.substring(1);
  6. if (path.equals(manifestName)) {
  7. manifest = null;
  8. if (resources.isEmpty())
  9. manifestFirst = true;
  10. }
  11. Map<String, Resource> s = directories.computeIfAbsent(getDirectory(path), dir -> {
  12. // make ancestor directories
  13. for (int n = dir.lastIndexOf('/'); n > 0; n = dir.lastIndexOf('/')) {
  14. dir = dir.substring(0, n);
  15. if (directories.containsKey(dir))
  16. break;
  17. directories.put(dir, null);
  18. }
  19. return new TreeMap<>();
  20. });
  21. boolean duplicate = s.containsKey(path);
  22. if (!duplicate || overwrite) {
  23. resources.put(path, resource);
  24. s.put(path, resource);
  25. }
  26. return duplicate;
  27. }

相关文章