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

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

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

Fingerprint.getConfigFile介绍

[英]The file we save our configuration.
[中]我们保存配置的文件。

代码示例

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

/**
 * Save the settings to a file.
 * @throws IOException Save error
 */
public synchronized void save() throws IOException {
  if(BulkChange.contains(this))   return;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  File file = getFingerprintFile(md5sum);
  save(file);
  SaveableListener.fireOnChange(this, getConfigFile(file));
  if(logger.isLoggable(Level.FINE))
    logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
}

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

/*package*/ static @CheckForNull Fingerprint load(@Nonnull File file) throws IOException {
  XmlFile configFile = getConfigFile(file);
  if(!configFile.exists())
    return null;

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

getConfigFile(file).write(this);

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

/**
 * Save the settings to a file.
 */
public synchronized void save() throws IOException {
  if(BulkChange.contains(this))   return;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  File file = getFingerprintFile(md5sum);
  getConfigFile(file).write(this);
  SaveableListener.fireOnChange(this, getConfigFile(file));
  if(logger.isLoggable(Level.FINE))
    logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
}

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

/**
 * Save the settings to a file.
 */
public synchronized void save() throws IOException {
  if(BulkChange.contains(this))   return;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  File file = getFingerprintFile(md5sum);
  getConfigFile(file).write(this);
  SaveableListener.fireOnChange(this, getConfigFile(file));
  if(logger.isLoggable(Level.FINE))
    logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
}

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

/**
 * Save the settings to a file.
 */
public synchronized void save() throws IOException {
  if(BulkChange.contains(this))   return;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  File file = getFingerprintFile(md5sum);
  getConfigFile(file).write(this);
  SaveableListener.fireOnChange(this, getConfigFile(file));
  if(logger.isLoggable(Level.FINE))
    logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
}

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

/**
 * Save the settings to a file.
 */
public synchronized void save() throws IOException {
  if (BulkChange.contains(this)) {
    return;
  }
  long start = 0;
  if (logger.isLoggable(Level.FINE)) {
    start = System.currentTimeMillis();
  }
  File file = getFingerprintFile(md5sum);
  getConfigFile(file).write(this);
  SaveableListener.fireOnChange(this, getConfigFile(file));
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("Saving fingerprint " + file + " took " + (System.currentTimeMillis() - start) + "ms");
  }
}

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

/*package*/ static Fingerprint load(File file) throws IOException {
  XmlFile configFile = getConfigFile(file);
  if(!configFile.exists())
    return null;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  try {
    Fingerprint f = (Fingerprint) configFile.read();
    if(logger.isLoggable(Level.FINE))
      logger.fine("Loading fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
    return f;
  } catch (IOException e) {
    if(file.exists() && file.length()==0) {
      // Despite the use of AtomicFile, there are reports indicating that people often see
      // empty XML file, presumably either due to file system corruption (perhaps by sudden
      // power loss, etc.) or abnormal program termination.
      // generally we don't want to wipe out user data just because we can't load it,
      // but if the file size is 0, which is what's reported in HUDSON-2012, then it seems
      // like recovering it silently by deleting the file is not a bad idea.
      logger.log(Level.WARNING, "Size zero fingerprint. Disk corruption? "+configFile,e);
      file.delete();
      return null;
    }
    logger.log(Level.WARNING, "Failed to load "+configFile,e);
    throw e;
  }
}

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

/*package*/ static Fingerprint load(File file) throws IOException {
  XmlFile configFile = getConfigFile(file);
  if(!configFile.exists())
    return null;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  try {
    Fingerprint f = (Fingerprint) configFile.read();
    if(logger.isLoggable(Level.FINE))
      logger.fine("Loading fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
    return f;
  } catch (IOException e) {
    if(file.exists() && file.length()==0) {
      // Despite the use of AtomicFile, there are reports indicating that people often see
      // empty XML file, presumably either due to file system corruption (perhaps by sudden
      // power loss, etc.) or abnormal program termination.
      // generally we don't want to wipe out user data just because we can't load it,
      // but if the file size is 0, which is what's reported in HUDSON-2012, then it seems
      // like recovering it silently by deleting the file is not a bad idea.
      logger.log(Level.WARNING, "Size zero fingerprint. Disk corruption? "+configFile,e);
      file.delete();
      return null;
    }
    logger.log(Level.WARNING, "Failed to load "+configFile,e);
    throw e;
  }
}

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

/*package*/ static Fingerprint load(File file) throws IOException {
  XmlFile configFile = getConfigFile(file);
  if(!configFile.exists())
    return null;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  try {
    Fingerprint f = (Fingerprint) configFile.read();
    if(logger.isLoggable(Level.FINE))
      logger.fine("Loading fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
    return f;
  } catch (IOException e) {
    if(file.exists() && file.length()==0) {
      // Despite the use of AtomicFile, there are reports indicating that people often see
      // empty XML file, presumably either due to file system corruption (perhaps by sudden
      // power loss, etc.) or abnormal program termination.
      // generally we don't want to wipe out user data just because we can't load it,
      // but if the file size is 0, which is what's reported in HUDSON-2012, then it seems
      // like recovering it silently by deleting the file is not a bad idea.
      logger.log(Level.WARNING, "Size zero fingerprint. Disk corruption? "+configFile,e);
      file.delete();
      return null;
    }
    logger.log(Level.WARNING, "Failed to load "+configFile,e);
    throw e;
  }
}

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

/**
 * Save the settings to a file.
 * @throws IOException Save error
 */
public synchronized void save() throws IOException {
  if(BulkChange.contains(this))   return;
  long start=0;
  if(logger.isLoggable(Level.FINE))
    start = System.currentTimeMillis();
  File file = getFingerprintFile(md5sum);
  save(file);
  SaveableListener.fireOnChange(this, getConfigFile(file));
  if(logger.isLoggable(Level.FINE))
    logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
}

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

/*package*/ static Fingerprint load(File file) throws IOException {
  XmlFile configFile = getConfigFile(file);
  if (!configFile.exists()) {
    return null;

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

/*package*/ static @CheckForNull Fingerprint load(@Nonnull File file) throws IOException {
  XmlFile configFile = getConfigFile(file);
  if(!configFile.exists())
    return null;

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

getConfigFile(file).write(this);

相关文章