本文整理了Java中jodd.io.FileUtil.isOlder()
方法的一些代码示例,展示了FileUtil.isOlder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.isOlder()
方法的具体详情如下:
包路径:jodd.io.FileUtil
类名称: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));
}
内容来源于网络,如有侵权,请联系作者删除!