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

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

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

Jar.getDirectory介绍

暂无

代码示例

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

public Resource remove(String path) {
  Resource resource = resources.remove(path);
  String dir = getDirectory(path);
  Map<String, Resource> mdir = directories.get(dir);
  // must be != null
  mdir.remove(path);
  return resource;
}

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

public Resource remove(String path) {
  Resource resource = resources.remove(path);
  String dir = getDirectory(path);
  Map<String, Resource> mdir = directories.get(dir);
  // must be != null
  mdir.remove(path);
  return resource;
}

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

public boolean putResource(String path, Resource resource, boolean overwrite) {
  updateModified(resource.lastModified(), path);
  if (path.equals("META-INF/MANIFEST.MF")) {
    manifest = null;
    if (resources.isEmpty())
      manifestFirst = true;
  }
  String dir = getDirectory(path);
  Map<String, Resource> s = directories.get(dir);
  if (s == null) {
    s = new TreeMap<String, Resource>();
    directories.put(dir, s);
    int n = dir.lastIndexOf('/');
    while (n > 0) {
      String dd = dir.substring(0, n);
      if (directories.containsKey(dd))
        break;
      directories.put(dd, null);
      n = dd.lastIndexOf('/');
    }
  }
  boolean duplicate = s.containsKey(path);
  if (!duplicate || overwrite) {
    resources.put(path, resource);
    s.put(path, resource);
  }
  return duplicate;
}

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

public boolean putResource(String path, Resource resource, boolean overwrite) {
  updateModified(resource.lastModified(), path);
  while (path.startsWith("/"))
    path = path.substring(1);
  if (path.equals("META-INF/MANIFEST.MF")) {
    manifest = null;
    if (resources.isEmpty())
      manifestFirst = true;
  }
  String dir = getDirectory(path);
  Map<String, Resource> s = directories.get(dir);
  if (s == null) {
    s = new TreeMap<String, Resource>();
    directories.put(dir, s);
    int n = dir.lastIndexOf('/');
    while (n > 0) {
      String dd = dir.substring(0, n);
      if (directories.containsKey(dd))
        break;
      directories.put(dd, null);
      n = dd.lastIndexOf('/');
    }
  }
  boolean duplicate = s.containsKey(path);
  if (!duplicate || overwrite) {
    resources.put(path, resource);
    s.put(path, resource);
  }
  return duplicate;
}

相关文章