class Dumper {

    public void dump( Path dbPath, Path transactionalLogsPath, Path archive, CompressionFormat format, Predicate<Path> exclude ) throws IOException
    {
        checkWritableDirectory( archive.getParent() );
        operations.clear();

        visitPath( dbPath, exclude );
        if ( !Util.isSameOrChildPath( dbPath, transactionalLogsPath ) )
        {
            visitPath( transactionalLogsPath, exclude );
        }

        progressPrinter.reset();
        for ( ArchiveOperation operation : operations )
        {
            progressPrinter.maxBytes += operation.size;
            progressPrinter.maxFiles += operation.isFile ? 1 : 0;
        }

        try ( ArchiveOutputStream stream = openArchiveOut( archive, format );
              Resource ignore = progressPrinter.startPrinting() )
        {
            for ( ArchiveOperation operation : operations )
            {
                operation.addToArchive( stream );
            }
        }
    }

    @VisibleForTesting  Dumper();
    public  Dumper( PrintStream output );

}