class ResumeFilter extends AbstractUploadFilter {

    @Override
    public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException {
        if(super.accept(file, local, parent)) {
            if(local.isFile()) {
                if(parent.isExists()) {
                    final Write.Append append = upload.append(file, local.attributes().getSize(), cache);
                    if(append.size == local.attributes().getSize()) {
                        if(Checksum.NONE != append.checksum) {
                            final ChecksumCompute compute = ChecksumComputeFactory.get(append.checksum.algorithm);
                            if(compute.compute(local.getInputStream(), parent).equals(append.checksum)) {
                                if(log.isInfoEnabled()) {
                                    log.info(String.format("Skip file %s with checksum %s", file, local.attributes().getChecksum()));
                                }
                                return false;
                            }
                            log.warn(String.format("Checksum mismatch for %s and %s", file, local));
                        }
                        else {
                            if(log.isInfoEnabled()) {
                                log.info(String.format("Skip file %s with remote size %d", file, append.size));
                            }
                            // No need to resume completed transfers
                            return false;
                        }
                    }
                }
            }
            return true;
        }
        return false;
    }

    public  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session);
    public  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options);
    public  ResumeFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                        final UploadFilterOptions options, final Upload upload);

}