*
*/
public class ImportFolder extends AbstractSubscriber {
public void onMessage(Message message) {
SimpleMessage msg = (SimpleMessage)message;
String path = msg.getMessage();
getBusiness().getFolderBusiness().createFolder(path);
VfsNode node = VfsNode.find(path);
if (node == null) {
logger.error("VFS node not found " + path);
return;
}
for (VfsNode child : node.getChildren()) {
if (child.isDirectory()) {
getBusiness().getMessageQueue().publish(new SimpleMessage(
Topic.IMPORT_FOLDER, child.getPath()));
}
else {
getBusiness().getMessageQueue().publish(new SimpleMessage(
Topic.IMPORT_FILE, child.getPath()));
}
}
}