@Override
    public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException {
        if(local.isFile()) {
            if(local.exists()) {
                // Read remote attributes
                final PathAttributes attributes = attribute.find(file);
                if(local.attributes().getSize() == attributes.getSize()) {
                    if(Checksum.NONE != attributes.getChecksum()) {
                        final ChecksumCompute compute = ChecksumComputeFactory.get(attributes.getChecksum().algorithm);
                        if(compute.compute(local.getInputStream(), parent).equals(attributes.getChecksum())) {
                            if(log.isInfoEnabled()) {
                                log.info(String.format("Skip file %s with checksum %s", file, attributes.getChecksum()));
                            }
                            return false;
                        }
                        else {
                            log.warn(String.format("Checksum mismatch for %s and %s", file, local));
                        }
                    }
                    else {
                        if(log.isInfoEnabled()) {
                            log.info(String.format("Skip file %s with local size %d", file, local.attributes().getSize()));
                        }
                        // No need to resume completed transfers
                        return false;
                    }
                }
            }
        }
        return super.accept(file, local, parent);
    }
@Test
    public void testAcceptExistsFalse() throws Exception {
        ResumeFilter f = new ResumeFilter(new DisabledDownloadSymlinkResolver(), new NullSession(new Host(new TestProtocol())));
        Path p = new Path("a", EnumSet.of(Path.Type.file));
        p.attributes().setSize(2L);
        assertTrue(f.accept(p, new NullLocal("~/Downloads", "a") {
            @Override
            public boolean exists() {
                return false;
            }
        }, new TransferStatus()));
    }