use of org.nzbhydra.config.DownloaderConfig in project nzbhydra2 by theotherp.
the class DownloaderProvider method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
if (baseConfig.getDownloading().getDownloaders() != null) {
List<DownloaderConfig> downloaderConfigs = baseConfig.getDownloading().getDownloaders();
downloadersMap.clear();
logger.info("Loading downloaders");
for (DownloaderConfig downloaderConfig : downloaderConfigs) {
logger.info("Initializing downloader {}", downloaderConfig.getName());
try {
Downloader downloader = beanFactory.createBean(downloaderClasses.get(downloaderConfig.getDownloaderType()));
downloader.intialize(downloaderConfig);
downloadersMap.put(downloaderConfig.getName().toLowerCase(), downloader);
} catch (Exception e) {
logger.error("Error while initializing downloader", e);
}
}
if (downloadersMap.isEmpty()) {
logger.info("No downloaders configured");
}
} else {
logger.error("Configuration incomplete, no downloaders found");
}
}
use of org.nzbhydra.config.DownloaderConfig in project nzbhydra2 by theotherp.
the class DownloaderTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
testee.nzbHandler = nzbHandler;
testee.searchResultRepository = searchResultRepository;
testee.downloaderConfig = new DownloaderConfig();
when(downloadEntityMock.getSearchResult()).thenReturn(searchResultEntityMock);
when(downloadEntityMock.getStatus()).thenReturn(FileDownloadStatus.REQUESTED);
}
Aggregations