for (Resource resource : resources) {
String path = resource.getPath();
try {
Version v = getAppropriateVersion(resource, date, session);
if (v == null) {
results.add(new ReplicationResult(path, Status.not_replicated));
continue;
}
String versionName = v.getName();
opts.setRevision(versionName);
replicator.replicate(session, ReplicationActionType.ACTIVATE, path, opts);
results.add(new ReplicationResult(path, Status.replicated, versionName));
} catch (RepositoryException e) {
results.add(new ReplicationResult(path, Status.error));
log.error("Exception while replicating version of " + path, e);
} catch (ReplicationException e) {
results.add(new ReplicationResult(path, Status.error));
log.error("Exception while replicating version of " + path, e);
}
}
return results;