private void blockUntilDownloadFinish(List<FutureTask<Boolean>> tasks) {
        try {
            for (FutureTask<Boolean> task : tasks) {
                task.get();
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }