package org.rmatil.sync.event.aggregator.core.modifier;

import org.rmatil.sync.event.aggregator.core.events.IEvent;
import org.rmatil.sync.event.aggregator.core.events.ModifyEvent;

import java.util.ArrayList;
import java.util.List;

/**
 * Modifies the list of events in such a way, that notifications
 * about a change in a directory do not get propagated further.
 */
public class IgnoreDirectoryModifier implements IModifier {

    @Override
    public List<IEvent> modify(List<IEvent> events) {
        List<IEvent> modifiedEvents = new ArrayList<>();

        for (IEvent event : events) {
            if (! (event instanceof ModifyEvent && event.getPath().toFile().isDirectory())) {
                modifiedEvents.add(event);
            }
        }

        return modifiedEvents;
    }
}

@@ -174,16 +174,73 @@
 fyEvent;
+%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0Aimport
@@ -483,16 +483,106 @@
 fier %7B%0A%0A
+    final static Logger logger = LoggerFactory.getLogger(IgnoreDirectoryModifier.class);%0A%0A
     @Ove
@@ -827,24 +827,24 @@
 ctory())) %7B%0A
-
             
@@ -874,16 +874,125 @@
 event);%0A
+            %7D else %7B%0A                logger.trace(%22Ignoring modify event for directory %22 + event.getPath());%0A
         

Add log statement on ignore