@@ -0,0 +1,1622 @@
+package uk.ac.ebi.quickgo.annotation.metadata;%0A%0Aimport uk.ac.ebi.quickgo.rest.metadata.MetaData;%0Aimport uk.ac.ebi.quickgo.rest.metadata.MetaDataProvider;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.util.List;%0Aimport java.util.function.Function;%0Aimport java.util.stream.Stream;%0Aimport org.springframework.beans.factory.annotation.Value;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.core.io.Resource;%0A%0Aimport static java.util.stream.Collectors.toList;%0A%0A/**%0A * Configure the provision of metadata for the Annotation service.%0A *%0A * @author Tony Wardell%0A * Date: 07/03/2017%0A * Time: 10:55%0A * Created with IntelliJ IDEA.%0A */%0A@Configuration%0Apublic class MetaDataConfig %7B%0A    private static final String SERVICE = %22Annotation%22;%0A    private static final Path DEFAULT_METADATA_PATH = Paths.get(%22goa_uniprot.gpa-version%22);%0A    private static final Function%3CStream%3CString%3E, List%3CMetaData%3E%3E META_DATA_MAPPER = (Stream%3CString%3E str) -%3E str%0A        .map(s -%3E new MetaData(null, s.substring(s.indexOf(%222%22))))%0A        .collect(toList());%0A    private static final int NUMBER_OF_METADATA_LINES = 1;%0A%0A    @Value(%22$%7Bannotation.metadata.source%7D%22)%0A    private Resource source;%0A%0A    @Bean%0A    MetaDataProvider metaDataProvider() throws IOException %7B%0A        Path metaDataPath = source != null ? Paths.get(source.getURI()) : DEFAULT_METADATA_PATH;%0A        return new MetaDataProvider(SERVICE, META_DATA_MAPPER, Files.lines(metaDataPath), NUMBER_OF_METADATA_LINES);%0A    %7D%0A%7D%0A

Configure the provision of metadata for the Annotation service.