package de.duehl.html.download.start;

import de.duehl.html.download.Downloader;
import de.duehl.html.download.data.DownloadInfo;

public class RunDownloaderDuehlDeTextFileSimple {

    public static void main(String[] args) {
        Downloader downloader = new Downloader("https://www.duehl.de/vokabel_trainer_japanisch/"
                + "Neuste_Version_Programm.txt")
                //.setLogger(logger)
                //.useProxy(PROXY_40)
                .disableRedirectHandling()
                //.multipleDownloadTries(10, 120)
                ;
        DownloadInfo info = downloader.download();

        System.out.println("Status: " + info.getStatus().getStatusCode() + " - "
                + info.getStatus().getDescription());
        System.out.println("Original-Status-Code: " + info.getOriginalHttpStatusCode());
        System.out.println("Originale Url : " + info.getUrl());
        System.out.println("Redirected Url: " + info.getReturnedUrl());
        System.out.println("Seitentext:\n" + info.getContent());
    }

}
