try {
logger.info("Synchronization started");
logger.info(" source: " + taskTree.getSource().getConnectionDescription().getDisplayPath());
logger.info(" destination: " + taskTree.getDestination().getConnectionDescription().getDisplayPath());
BlockBuffer buffer = new BlockBuffer(logger);
TaskExecutor queue = new FillBufferTaskExecutor(buffer);
if (listener != null) {
queue.addTaskFinishedListener(listener);
}
buffer.load();
queue.enqueue(taskTree);
queue.flush();
buffer.unload();
taskTree.getSource().flush();
taskTree.getDestination().flush();
taskTree.getSource().close();
taskTree.getDestination().close();