org.apache.tools.ant.util.FileUtils.isUpToDate()方法的使用及代码示例

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

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

FileUtils.isUpToDate介绍

[英]Compare two timestamps for being up to date using the current granularity.
[中]

代码示例

代码示例来源:origin: org.apache.ant/ant

/**
 * Returns true if the source is older than the dest.
 * If the dest file does not exist, then the test returns false; it is
 * implicitly not up do date.
 * @param source source file (should be the older).
 * @param dest dest file (should be the newer).
 * @param granularity an offset added to the source time.
 * @return true if the source is older than the dest after accounting
 *              for granularity.
 * @since Ant 1.6.3
 */
public boolean isUpToDate(File source, File dest, long granularity) {
  //do a check for the destination file existing
  if (!dest.exists()) {
    //if it does not, then the file is not up to date.
    return false;
  }
  long sourceTime = source.lastModified();
  long destTime = dest.lastModified();
  return isUpToDate(sourceTime, destTime, granularity);
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Returns true if the source is older than the dest.
 * @param source source file (should be the older).
 * @param dest dest file (should be the newer).
 * @return true if the source is older than the dest, taking the granularity into account.
 * @since Ant 1.6.3
 */
public boolean isUpToDate(File source, File dest) {
  return isUpToDate(source, dest, getFileTimestampGranularity());
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Compare two timestamps for being up to date using the
 * current granularity.
 *
 * @param sourceTime  timestamp of source file.
 * @param destTime    timestamp of dest file.
 * @return true if the dest file is considered up to date.
 */
public boolean isUpToDate(long sourceTime, long destTime) {
  return isUpToDate(sourceTime, destTime, getFileTimestampGranularity());
}

代码示例来源:origin: org.apache.ant/ant

return FILE_UTILS.isUpToDate(jarFile, destFile);

代码示例来源:origin: de.rototor.jeuclid/jeuclid-core

this.log("Output file: " + outFile, Project.MSG_DEBUG);
if (this.mforce
    || !this.fileUtils.isUpToDate(inFile, outFile)) {
  this.fileUtils.createNewFile(outFile, true);
  Converter.getInstance().convert(inFile, outFile,

相关文章