class SynchronizationPathFilter implements TransferPathFilter {

    @Override
    public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException {
        switch(comparison.compare(file, local)) {
            case equal:
                return file.isDirectory();
            case remote:
                if(action.equals(TransferAction.upload)) {
                    if(log.isInfoEnabled()) {
                        log.info(String.format("Skip file %s with comparison result %s because action is %s",
                            file, Comparison.remote, action));
                    }
                    return false;
                }
                // Include for mirror and download. Ask the download delegate for inclusion
                return downloadFilter.accept(file, local, parent);
            case local:
                if(action.equals(TransferAction.download)) {
                    if(log.isInfoEnabled()) {
                        log.info(String.format("Skip file %s with comparison result %s because action is %s",
                            file, Comparison.local, action));
                    }
                    return false;
                }
                // Include for mirror and download. Ask the upload delegate for inclusion
                return uploadFilter.accept(file, local, parent);
        }
        // Not equal
        return false;
    }

    public  SynchronizationPathFilter(final ComparePathFilter comparison,
                                     final TransferPathFilter downloadFilter,
                                     final TransferPathFilter uploadFilter,
                                     final TransferAction action);

}