hudson.model.Fingerprint.isAlive()方法的使用及代码示例

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

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

Fingerprint.isAlive介绍

[英]Returns true if any of the builds recorded in this fingerprint is still retained.

This is used to find out old fingerprint records that can be removed without losing too much information.
[中]如果此指纹中记录的任何生成仍然保留,则返回true。
这用于查找旧的指纹记录,这些记录可以在不丢失太多信息的情况下删除。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Examines the file and returns true if a file was deleted.
 */
private boolean check(File fingerprintFile, TaskListener listener) {
  try {
    Fingerprint fp = loadFingerprint(fingerprintFile);
    if (fp == null || !fp.isAlive()) {
      listener.getLogger().println("deleting obsolete " + fingerprintFile);
      fingerprintFile.delete();
      return true;
    } else {
      // get the fingerprint in the official map so have the changes visible to Jenkins
      // otherwise the mutation made in FingerprintMap can override our trimming.
      fp = getFingerprint(fp);
      return fp.trim();
    }
  } catch (IOException e) {
    Functions.printStackTrace(e, listener.error("Failed to process " + fingerprintFile));
    return false;
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Examines the file and returns true if a file was deleted.
 */
private boolean check(File fingerprintFile) {
  try {
    Fingerprint fp = Fingerprint.load(fingerprintFile);
    if(!fp.isAlive()) {
      fingerprintFile.delete();
      return true;
    }
  } catch (IOException e) {
    logger.log(Level.WARNING, "Failed to process "+fingerprintFile, e);
  }
  return false;
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Examines the file and returns true if a file was deleted.
 */
private boolean check(File fingerprintFile) {
  try {
    Fingerprint fp = Fingerprint.load(fingerprintFile);
    if(!fp.isAlive()) {
      fingerprintFile.delete();
      return true;
    }
  } catch (IOException e) {
    logger.log(Level.WARNING, "Failed to process "+fingerprintFile, e);
  }
  return false;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Examines the file and returns true if a file was deleted.
 */
private boolean check(File fingerprintFile) {
  try {
    Fingerprint fp = Fingerprint.load(fingerprintFile);
    if(!fp.isAlive()) {
      fingerprintFile.delete();
      return true;
    }
  } catch (IOException e) {
    logger.log(Level.WARNING, "Failed to process "+fingerprintFile, e);
  }
  return false;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Examines the file and returns true if a file was deleted.
 */
private boolean check(File fingerprintFile) {
  try {
    Fingerprint fp = Fingerprint.load(fingerprintFile);
    if (!fp.isAlive()) {
      fingerprintFile.delete();
      return true;
    }
  } catch (IOException e) {
    logger.log(Level.WARNING, "Failed to process " + fingerprintFile, e);
  }
  return false;
}
private static final FileFilter LENGTH2DIR_FILTER = new FileFilter() {

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Examines the file and returns true if a file was deleted.
 */
private boolean check(File fingerprintFile, TaskListener listener) {
  try {
    Fingerprint fp = Fingerprint.load(fingerprintFile);
    if (fp == null || !fp.isAlive()) {
      listener.getLogger().println("deleting obsolete " + fingerprintFile);
      fingerprintFile.delete();
      return true;
    } else {
      // get the fingerprint in the official map so have the changes visible to Jenkins
      // otherwise the mutation made in FingerprintMap can override our trimming.
      listener.getLogger().println("possibly trimming " + fingerprintFile);
      fp = Jenkins.getInstance()._getFingerprint(fp.getHashString());
      return fp.trim();
    }
  } catch (IOException e) {
    Functions.printStackTrace(e, listener.error("Failed to process " + fingerprintFile));
    return false;
  }
}

相关文章