void download(ResourceDescriptor rds, File path) throws Exception { logger.debug("starting download {}", path); Exception exception = new Exception(); event(TYPE.START_DOWNLOAD, rds, null); for (int i = 0; i < 3; sleep(3000), i++) try { download0(rds.url, path, rds.id); event(TYPE.END_DOWNLOAD, rds, null); logger.debug("succesful download {}", path); failures.remove(rds.url); return; } catch (FileNotFoundException e) { logger.debug("no such file download {}", path); exception = e; break; // no use retrying } catch (Exception e) { logger.debug("exception download {}", path); exception = e; } failures.put(rds.url, System.currentTimeMillis()); logger.debug("failed download {}", path, exception); event(TYPE.ERROR, rds, exception); event(TYPE.END_DOWNLOAD, rds, exception); throw exception; }
void download(ResourceDescriptor rds, File path) throws Exception { logger.debug("starting download {}", path); Exception exception = new Exception(); event(TYPE.START_DOWNLOAD, rds, null); for (int i = 0; i < 3; sleep(3000), i++) try { download0(rds.url, path, rds.id); event(TYPE.END_DOWNLOAD, rds, null); logger.debug("succesful download {}", path); failures.remove(rds.url); return; } catch (FileNotFoundException e) { logger.debug("no such file download {}", path); exception = e; break; // no use retrying } catch (Exception e) { logger.debug("exception download {}", path); exception = e; } failures.put(rds.url, System.currentTimeMillis()); logger.debug("failed download {}", path, exception); event(TYPE.ERROR, rds, exception); event(TYPE.END_DOWNLOAD, rds, exception); throw exception; }
void download(ResourceDescriptor rds, File path) throws Exception { reporter.trace("starting download %s", path); Exception exception = new Exception(); event(TYPE.START_DOWNLOAD, rds, null); for (int i = 0; i < 3; sleep(3000), i++) try { download0(rds.url, path, rds.id); event(TYPE.END_DOWNLOAD, rds, null); reporter.trace("succesful download %s", path); failures.remove(rds.url); return; } catch (FileNotFoundException e) { reporter.trace("no such file download %s", path); exception = e; break; // no use retrying } catch (Exception e) { reporter.trace("exception download %s", path); exception = e; } failures.put(rds.url, System.currentTimeMillis()); reporter.trace("failed download %s", path); event(TYPE.ERROR, rds, exception); event(TYPE.END_DOWNLOAD, rds, exception); throw exception; }
void download(ResourceDescriptor rds, File path) throws Exception { reporter.trace("starting download %s", path); Exception exception = new Exception(); event(TYPE.START_DOWNLOAD, rds, null); for (int i = 0; i < 3; sleep(3000), i++) try { download0(rds.url, path, rds.id); event(TYPE.END_DOWNLOAD, rds, null); reporter.trace("succesful download %s", path); failures.remove(rds.url); return; } catch (FileNotFoundException e) { reporter.trace("no such file download %s", path); exception = e; break; // no use retrying } catch (Exception e) { reporter.trace("exception download %s", path); exception = e; } failures.put(rds.url, System.currentTimeMillis()); reporter.trace("failed download %s", path); event(TYPE.ERROR, rds, exception); event(TYPE.END_DOWNLOAD, rds, exception); throw exception; }