use of org.apache.tools.ant.types.resources.selectors.Date in project ant by apache.
the class ResourceUtils method logFuture.
/**
* Log which Resources (if any) have been modified in the future.
* @param logTo the ProjectComponent to do the logging.
* @param rc the collection of Resources to check.
* @param granularity the timestamp granularity to use.
* @since Ant 1.7
*/
private static void logFuture(final ProjectComponent logTo, final ResourceCollection rc, final long granularity) {
final long now = System.currentTimeMillis() + granularity;
final Date sel = new Date();
sel.setMillis(now);
sel.setWhen(TimeComparison.AFTER);
final Restrict future = new Restrict();
future.add(sel);
future.add(rc);
for (final Resource r : future) {
logTo.log("Warning: " + r.getName() + " modified in the future.", Project.MSG_WARN);
}
}
Aggregations