class DownloadManager extends TransferenceManager {

    private static final Logger LOG = Logger.getLogger(DownloadManager.class.getName());

    public DownloadManager(MainPanel main_panel) {

        super(main_panel, main_panel.getMax_dl(), main_panel.getView().getStatus_down_label(), main_panel.getView().getjPanel_scroll_down(), main_panel.getView().getClose_all_finished_down_button(), main_panel.getView().getPause_all_down_button(), main_panel.getView().getClean_all_down_menu());
    }

    public synchronized void forceResetAllChunks() {
        THREAD_POOL.execute(() -> {

            ConcurrentLinkedQueue<Transference> transference_running_list = getMain_panel().getDownload_manager().getTransference_running_list();

            if (!transference_running_list.isEmpty()) {
                transference_running_list.forEach((transference) -> {

                    ArrayList<ChunkDownloader> chunkworkers = ((Download) transference).getChunkworkers();

                    chunkworkers.forEach((worker) -> {
                        worker.RESET_CURRENT_CHUNK();
                    });

                });

                MiscTools.GUIRun(() -> {
                    getMain_panel().getView().getForce_chunk_reset_button().setEnabled(true);
                });

                JOptionPane.showMessageDialog(getMain_panel().getView(), LabelTranslatorSingleton.getInstance().translate("CURRENT DOWNLOAD CHUNKS RESET!"));
            }

        });
    }

    @Override
    public void closeAllFinished() {

        _transference_finished_queue.stream().filter((t) -> (!t.isCanceled())).map((t) -> {
            _transference_finished_queue.remove(t);
            return t;
        }).forEachOrdered((t) -> {
            _transference_remove_queue.add(t);
        });

        secureNotify();
    }

    public int copyAllLinksToClipboard() {

        int total = 0;

        ArrayList<String> links = new ArrayList<>();

        String out = "***PROVISIONING DOWNLOADS***\r\n\r\n";

        for (Transference t : _transference_provision_queue) {

            links.add(((Download) t).getUrl());
        }

        out += String.join("\r\n", links);

        total += links.size();

        links.clear();

        out += "\r\n\r\n***WAITING DOWNLOADS***\r\n\r\n";

        for (Transference t : _transference_waitstart_aux_queue) {

            links.add(((Download) t).getUrl());
        }

        for (Transference t : _transference_waitstart_queue) {

            links.add(((Download) t).getUrl());
        }

        out += String.join("\r\n", links);

        total += links.size();

        links.clear();

        out += "\r\n\r\n***RUNNING DOWNLOADS***\r\n\r\n";

        for (Transference t : _transference_running_list) {

            links.add(((Download) t).getUrl());
        }

        out += String.join("\r\n", links);

        total += links.size();

        links.clear();

        out += "\r\n\r\n***FINISHED DOWNLOADS***\r\n\r\n";

        for (Transference t : _transference_finished_queue) {

            links.add(((Download) t).getUrl());
        }

        out += String.join("\r\n", links);

        total += links.size();

        MiscTools.copyTextToClipboard(out);

        return total;

    }

    @Override
    public void remove(Transference[] downloads) {<FILL_FUNCTION_BODY>}

    @Override
    public void provision(final Transference download) {
        MiscTools.GUIRun(() -> {
            getScroll_panel().add(((Download) download).getView());
        });

        try {

            _provision((Download) download, false);

            secureNotify();

        } catch (APIException ex) {

            LOG.log(Level.INFO, "{0} Provision failed! Retrying in separated thread...", Thread.currentThread().getName());

            THREAD_POOL.execute(() -> {
                try {

                    _provision((Download) download, true);

                } catch (APIException ex1) {

                    LOG.log(SEVERE, null, ex1);
                }

                secureNotify();
            });
        }

    }

    private void _provision(Download download, boolean retry) throws APIException {

        download.provisionIt(retry);

        if (download.isProvision_ok()) {

            increment_total_size(download.getFile_size());

            getTransference_waitstart_aux_queue().add(download);

        } else {
            getTransference_finished_queue().add(download);
        }
    }

}


        ArrayList<String> delete_down = new ArrayList<>();

        for (final Transference d : downloads) {

            MiscTools.GUIRun(() -> {
                getScroll_panel().remove(((Download) d).getView());
            });

            getTransference_waitstart_queue().remove(d);

            getTransference_running_list().remove(d);

            getTransference_finished_queue().remove(d);

            if (((Download) d).isProvision_ok()) {

                increment_total_size(-1 * d.getFile_size());

                increment_total_progress(-1 * d.getProgress());

                if (!d.isCanceled() || d.isClosed()) {
                    delete_down.add(((Download) d).getUrl());
                }
            }
        }

        try {
            deleteDownloads(delete_down.toArray(new String[delete_down.size()]));
        } catch (SQLException ex) {
            LOG.log(SEVERE, null, ex);
        }

        secureNotify();
    
<methods>public void <init>(com.tonikelope.megabasterd.MainPanel, int, javax.swing.JLabel, javax.swing.JPanel, javax.swing.JButton, javax.swing.JButton, javax.swing.MenuElement) ,public void bottomWaitQueue(com.tonikelope.megabasterd.Transference) ,public int calcTotalSlotsCount() ,public void cancelAllTransferences() ,public void closeAllFinished() ,public void closeAllPreProWaiting() ,public void downWaitQueue(com.tonikelope.megabasterd.Transference) ,public com.tonikelope.megabasterd.MainPanel getMain_panel() ,public javax.swing.JPanel getScroll_panel() ,public java.lang.Boolean getSort_wait_start_queue() ,public ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> getTransference_finished_queue() ,public ConcurrentLinkedQueue<java.lang.Object> getTransference_preprocess_global_queue() ,public ConcurrentLinkedQueue<java.lang.Runnable> getTransference_preprocess_queue() ,public ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> getTransference_provision_queue() ,public ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> getTransference_remove_queue() ,public ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> getTransference_running_list() ,public ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> getTransference_waitstart_aux_queue() ,public ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> getTransference_waitstart_queue() ,public java.lang.Object getWait_queue_lock() ,public long get_total_progress() ,public long get_total_size() ,public void increment_total_progress(long) ,public void increment_total_size(long) ,public boolean isAll_finished() ,public boolean isPaused_all() ,public boolean isPreprocessing_transferences() ,public boolean isProvisioning_transferences() ,public boolean isRemoving_transferences() ,public boolean isStarting_transferences() ,public boolean no_transferences() ,public void pauseAll() ,public abstract void provision(com.tonikelope.megabasterd.Transference) ,public abstract void remove(com.tonikelope.megabasterd.Transference[]) ,public void resumeAll() ,public void run() ,public void secureNotify() ,public void secureWait() ,public void setAll_finished(boolean) ,public void setMax_running_trans(int) ,public void setPaused_all(boolean) ,public void setPreprocessing_transferences(boolean) ,public void setProvisioning_transferences(boolean) ,public void setRemoving_transferences(boolean) ,public void setSort_wait_start_queue(java.lang.Boolean) ,public void setStarting_transferences(boolean) ,public void start(com.tonikelope.megabasterd.Transference) ,public void topWaitQueue(com.tonikelope.megabasterd.Transference) ,public void upWaitQueue(com.tonikelope.megabasterd.Transference) <variables>private static final java.util.logging.Logger LOG,public static final int MAX_PROVISION_WORKERS,public static final int MAX_WAIT_QUEUE,protected volatile boolean _all_finished,private final non-sealed javax.swing.MenuElement _clean_all_menu,private final non-sealed javax.swing.JButton _close_all_button,private final non-sealed com.tonikelope.megabasterd.MainPanel _main_panel,private int _max_running_trans,private volatile boolean _notified,private final non-sealed javax.swing.JButton _pause_all_button,private final non-sealed java.lang.Object _pause_all_lock,private volatile boolean _paused_all,private volatile boolean _preprocessing_transferences,private volatile boolean _provisioning_transferences,private volatile boolean _removing_transferences,private final non-sealed javax.swing.JPanel _scroll_panel,private final non-sealed java.lang.Object _secure_notify_lock,private volatile java.lang.Boolean _sort_wait_start_queue,private volatile boolean _starting_transferences,private final non-sealed javax.swing.JLabel _status,protected volatile long _total_progress,protected final non-sealed java.lang.Object _total_progress_lock,protected volatile long _total_size,protected final non-sealed java.lang.Object _total_size_lock,protected final non-sealed ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> _transference_finished_queue,protected final non-sealed ConcurrentLinkedQueue<java.lang.Object> _transference_preprocess_global_queue,protected final non-sealed ConcurrentLinkedQueue<java.lang.Runnable> _transference_preprocess_queue,protected final non-sealed ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> _transference_provision_queue,protected final non-sealed java.lang.Object _transference_queue_sort_lock,protected final non-sealed ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> _transference_remove_queue,protected final non-sealed ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> _transference_running_list,protected final non-sealed ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> _transference_waitstart_aux_queue,protected final non-sealed ConcurrentLinkedQueue<com.tonikelope.megabasterd.Transference> _transference_waitstart_queue,private boolean _tray_icon_finish,private final non-sealed java.lang.Object _wait_queue_lock