@Override
    public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException {
        if(super.accept(file, local, parent)) {
            final Comparison comparison = this.comparison.compare(file, local, listener);
            switch(comparison) {
                case local:
                    if(log.isInfoEnabled()) {
                        log.info(String.format("Skip file %s with comparison %s", file, comparison));
                    }
                    return false;
                case equal:
                    if(file.isDirectory()) {
                        return true;
                    }
                    if(log.isInfoEnabled()) {
                        log.info(String.format("Skip file %s with comparison %s", file, comparison));
                    }
                    return false;
                case remote:
                    return true;
            }
            log.warn(String.format("Invalid comparison result %s", comparison));
        }
        return false;
    }
@Test
    public void testAcceptDirectory() throws Exception {
        final CompareFilter filter = new CompareFilter(new DisabledDownloadSymlinkResolver(),
            new NullSession(new Host(new TestProtocol())), new DownloadFilterOptions(new Host(new TestProtocol())), new DisabledProgressListener(),
            new DefaultComparePathFilter(
                    new NullSession(new Host(new TestProtocol()))) {
                @Override
                public Comparison compare(final Path file, final Local local, final ProgressListener listener) {
                    return Comparison.equal;
                }
            });
        assertTrue(
                filter.accept(new Path("/n", EnumSet.of(Path.Type.directory)), new NullLocal("/n"),
                        new TransferStatus().exists(true)));
    }