jodd.io.FileUtil.isOlder()方法的使用及代码示例

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

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

FileUtil.isOlder介绍

[英]Tests if the specified File is older than the specified time reference.
[中]测试指定的文件是否早于指定的时间引用。

代码示例

代码示例来源:origin: redisson/redisson

public static boolean isOlder(File file, File reference) {
  if (!reference.exists()) {
    throw new IllegalArgumentException("Reference file not found: " + reference);
  }
  return isOlder(file, reference.lastModified());
}

代码示例来源:origin: redisson/redisson

public static boolean isOlder(String file, long timeMillis) {
  return isOlder(file(file), timeMillis);
}

代码示例来源:origin: oblac/jodd

/**
 * Uses {@link File#lastModified()} for reference.
 *
 * @see #isOlder(File, long)
 */
public static boolean isOlder(final File file, final File reference) {
  checkReferenceExists(reference);
  return isOlder(file, reference.lastModified());
}

代码示例来源:origin: oblac/jodd

/**
 * @see #isOlder(File, long)
 */
public static boolean isOlder(final String file, final long timeMillis) {
  return isOlder(file(file), timeMillis);
}

代码示例来源:origin: redisson/redisson

public static boolean isOlder(String file, String reference) {
  return isOlder(file(file), file(reference));
}

代码示例来源:origin: oblac/jodd

/**
 * @see #isOlder(File, File)
 */
public static boolean isOlder(final String file, final String reference) {
  return isOlder(file(file), file(reference));
}

代码示例来源:origin: oblac/jodd

@Test
void testFileManipulation() throws IOException {
  FileUtil.copy(new File(dataRoot, "sb.data"), new File(dataRoot, "sb1.data"));
  assertFalse(FileUtil.isNewer(new File(dataRoot, "sb.data"), new File(dataRoot, "sb1.data")));
  assertFalse(FileUtil.isOlder(new File(dataRoot, "sb.data"), new File(dataRoot, "sb1.data")));
  FileUtil.delete(new File(dataRoot, "sb1.data"));
}

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

/**
 * @see #isOlder(File, long)
 */
public static boolean isOlder(final String file, final long timeMillis) {
  return isOlder(file(file), timeMillis);
}

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

/**
 * Uses {@link File#lastModified()} for reference.
 *
 * @see #isOlder(File, long)
 */
public static boolean isOlder(final File file, final File reference) {
  checkReferenceExists(reference);
  return isOlder(file, reference.lastModified());
}

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

/**
 * @see #isOlder(File, File)
 */
public static boolean isOlder(final String file, final String reference) {
  return isOlder(file(file), file(reference));
}

相关文章