Create a download library and a download tool. * **`http(s)://`**: Maybe use https://github.com/apache/httpcomponents-client, maybe don't. Perhaps as a plugin. * **`scp://`** or `ssh://`: Maybe use https://github.com/hierynomus/sshj for ssh + `dd`. * **`file://`**: No libraries needed. Algorithm: 1. Parallel (threads = 2): * Get the Map<byte[], ChunkInfo> from the existing file, if exists. * Get the header of the remote file. 1. Parallel (threads = ?): * Copy existing chunks (by hash) to `outputfile.chunk.####` (where #### = chunk-num). * Parallel (threads = 5): * Download missing chunks to `outputfile.chunk.####` (where #### = chunk num). 1. Merge (cat) new header + downloaded chunks.
Activity