package uk.ac.ebi.quickgo.annotation.service.search;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
 * Configuration beans and details used for downloads.
 *
 * Created 04/01/17
 * @author Edd
 */
@Configuration
@EnableScheduling
public class DownloadConfig {

    @Bean
    public TaskExecutor taskExecutor() {
        // todo: currently setting small pool, but can make configurable
        ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor();
        pool.setCorePoolSize(2);
        pool.setMaxPoolSize(4);
        pool.setWaitForTasksToCompleteOnShutdown(true);
        return pool;
    }
}
@@ -47,16 +47,186 @@
 earch;%0A%0A
+import uk.ac.ebi.quickgo.annotation.converter.Header;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Paths;%0Aimport org.springframework.beans.factory.annotation.Value;%0A
 import o
@@ -269,16 +269,16 @@
 n.Bean;%0A
-
 import o
@@ -326,24 +326,69 @@
 figuration;%0A
+import org.springframework.core.io.Resource;%0A
 import org.s
@@ -732,16 +732,90 @@
 nfig %7B%0A%0A
+    @Value(%22$%7Bdownload.ontology.source%7D%22)%0A    private Resource resource;%0A%0A
     @Bea
@@ -1146,9 +1146,132 @@
 ;%0A    %7D%0A
-%7D
+%0A    @Bean%0A    public Header header() throws IOException %7B%0A        return new Header(Paths.get(resource.getURI()));%0A    %7D%0A%7D%0A

Add header resources.