File downloadToDir, String uniqueMetadataElement,
boolean deleteAfterDownload) throws ToManyFailedDownloadsException,
RemoteConnectionException, AlreadyInDatabaseException,
UndefinedTypeException, CatalogException, IOException {
if (this.failedDownloadList.size() > max_allowed_failed_downloads)
throw new ToManyFailedDownloadsException(
"Number of failed downloads exceeds "
+ max_allowed_failed_downloads
+ " . . . blocking all downloads from being added to queue . . . "
+ "reset error flag in order to force allow downloads into queue");
if (this.isDownloading(file)) {