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

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

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

Jar.updateModified介绍

暂无

代码示例

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

static void traverse(Jar jar, int rootlength, File directory,
    Pattern doNotCopy) {
  if (doNotCopy != null && doNotCopy.matcher(directory.getName()).matches())
    return;
  jar.updateModified(directory.lastModified(), "Dir change");
  
  File files[] = directory.listFiles();
  for (int i = 0; i < files.length; i++) {
    if (files[i].isDirectory())
      traverse(jar, rootlength, files[i], doNotCopy);
    else {
      String path = files[i].getAbsolutePath().substring(
          rootlength + 1);
      if (File.separatorChar != '/')
        path = path.replace(File.separatorChar, '/');
      jar.putResource(path, new FileResource(files[i]), true);
    }
  }
}

代码示例来源: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;
}

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

try {
  long modified = Long.parseLong(getProperty("base.modified"));
  dot.updateModified(modified, "Base modified");
} catch (Exception e) {
  error("The JAR is empty");
dot.updateModified(lastModified(), "Last Modified Processor");
dot.setName(getBsn());

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

try {
  long modified = Long.parseLong(getProperty("base.modified"));
  dot.updateModified(modified, "Base modified");
} catch (Exception e) {
  error("The JAR is empty: " + dot.getName());
dot.updateModified(lastModified(), "Last Modified Processor");
dot.setName(getBsn());

相关文章