use of org.jumpmind.symmetric.model.FileSnapshot in project symmetric-ds by JumpMind.
the class FileSyncService method saveDirectorySnapshot.
protected long saveDirectorySnapshot(FileTriggerRouter fileTriggerRouter, DirectorySnapshot dirSnapshot) {
long totalBytes = 0;
for (FileSnapshot fileSnapshot : dirSnapshot) {
File file = fileTriggerRouter.getFileTrigger().createSourceFile(fileSnapshot);
String filePath = file.getParentFile().getPath().replace('\\', '/');
String fileName = file.getName();
String nodeId = null;
if (engine.getParameterService().is(ParameterConstants.FILE_SYNC_PREVENT_PING_BACK)) {
nodeId = findSourceNodeIdFromFileIncoming(filePath, fileName, fileSnapshot.getFileModifiedTime());
}
if (StringUtils.isNotBlank(nodeId)) {
fileSnapshot.setLastUpdateBy(nodeId);
} else {
fileSnapshot.setLastUpdateBy(null);
}
log.debug("Captured change " + fileSnapshot);
totalBytes += fileSnapshot.getFileSize();
}
save(dirSnapshot);
return totalBytes;
}
Aggregations