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

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

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

Jar.remove介绍

暂无

代码示例

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

public boolean rename(String oldPath, String newPath) {
  Resource resource = remove(oldPath);
  if (resource == null)
    return false;
  return putResource(newPath, resource);
}

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

public boolean rename(String oldPath, String newPath) {
  Resource resource = remove(oldPath);
  if (resource == null)
    return false;
  return putResource(newPath, resource);
}

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

void createPatch(String old, String newer, String patch) throws Exception {
  Jar a = new Jar(new File(old));
  Manifest am = a.getManifest();
  Jar b = new Jar(new File(newer));
  Manifest bm = b.getManifest();
  Set<String> delete = newSet();
  for (String path : a.getResources().keySet()) {
    Resource br = b.getResource(path);
    if (br == null) {
      trace("DELETE    %s", path);
      delete.add(path);
    } else {
      Resource ar = a.getResource(path);
      if (isEqual(ar, br)) {
        trace("UNCHANGED %s", path);
        b.remove(path);
      } else
        trace("UPDATE    %s", path);
    }
  }
  bm.getMainAttributes().putValue("Patch-Delete", join(delete, ", "));
  bm.getMainAttributes().putValue("Patch-Version",
      am.getMainAttributes().getValue("Bundle-Version"));
  b.write(new File(patch));
  a.close();
  a.close();
}

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

void createPatch(String old, String newer, String patch) throws Exception {
  Jar a = new Jar(new File(old));
  Manifest am = a.getManifest();
  Jar b = new Jar(new File(newer));
  Manifest bm = b.getManifest();
  Set<String> delete = newSet();
  for (String path : a.getResources().keySet()) {
    Resource br = b.getResource(path);
    if (br == null) {
      trace("DELETE    %s", path);
      delete.add(path);
    } else {
      Resource ar = a.getResource(path);
      if (isEqual(ar, br)) {
        trace("UNCHANGED %s", path);
        b.remove(path);
      } else
        trace("UPDATE    %s", path);
    }
  }
  bm.getMainAttributes().putValue("Patch-Delete", join(delete, ", "));
  bm.getMainAttributes().putValue("Patch-Version",
      am.getMainAttributes().getValue("Bundle-Version"));
  b.write(new File(patch));
  a.close();
  a.close();
}

相关文章