while (tries > 0) {
Util.logi("Starting download of '%s', with %s trie(s) remaining", url, tries);
tries--;
download = new Download(url, tempfile.getPath());
download.setListener(listener);
download.run();
if (!download.isSuccess()) {
if (download.getOutFile() != null) {
download.getOutFile().delete();
}
Util.log("Download of " + url + " Failed!");