use of delta.downloads.DownloadException in project lotro-tools by dmorcellet.
the class MainTestDownloadQuestPage method main.
/**
* Main method.
* @param args Not used.
*/
public static void main(String[] args) {
String url = "http://lorebook.lotro.com/wiki/Special:LotroResource?id=1879210718";
Downloader d = new Downloader();
File tmpDir = FileSystem.getTmpDir();
File tmp = new File(tmpDir, "tmp.html");
try {
d.downloadToFile(url, tmp);
} catch (DownloadException de) {
_logger.error("Cannot download quest page!", de);
}
}
use of delta.downloads.DownloadException in project lotro-tools by dmorcellet.
the class ItemIconsDownloader method doIt.
private void doIt() {
DownloadService downloader = DownloadService.getInstance();
File toFile = new File("items.xml").getAbsoluteFile();
_toDir.mkdirs();
HashMap<Integer, Item> items = loadItemsFile(toFile);
System.out.println(items.size());
for (Integer id : items.keySet()) {
System.out.println(id);
String url = "http://lotro.fr/img/bdd/items/" + id + ".png";
File to = new File(_toDir, id + ".png");
try {
downloader.downloadToFile(url, to);
} catch (DownloadException de) {
_logger.error("Cannot fetch icon [" + url + "]!", de);
}
}
}
Aggregations