@@ -0,0 +1,1553 @@
+package no.uio.ifi.trackfind.backend.data.providers.blueprint;%0A%0Aimport com.google.common.collect.HashMultimap;%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport no.uio.ifi.trackfind.backend.data.providers.AbstractDataProvider;%0Aimport org.springframework.stereotype.Component;%0A%0Aimport java.io.InputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.net.URL;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * Draft of Data Provider for Blueprint (TrackHubRegistry).%0A *%0A * @author Dmytro Titov%0A */%0A@Slf4j%0A@Component%0Apublic class BlueprintDataProvider extends AbstractDataProvider %7B%0A%0A    private static final String FETCH_URL = %22https://raw.githubusercontent.com/elixir-no-nels/trackfind/scripting/blueprint.json%22;%0A%0A    /**%0A     * %7B@inheritDoc%7D%0A     */%0A    @Override%0A    protected void fetchData(String hubName) %7B%0A        HashMultimap%3CString, String%3E mapToSave = HashMultimap.create();%0A        try (InputStream inputStream = new URL(FETCH_URL).openStream();%0A             InputStreamReader reader = new InputStreamReader(inputStream)) %7B%0A            Map topMap = gson.fromJson(reader, Map.class);%0A            for (String category : Arrays.asList(%22studies%22, %22experiments%22, %22samples%22, %22tracks%22)) %7B%0A                List objects = (List) topMap.get(category);%0A                for (Object object : objects) %7B%0A                    mapToSave.put(category, gson.toJson(object));%0A                %7D%0A            %7D%0A        %7D catch (Exception e) %7B%0A            log.error(e.getMessage(), e);%0A        %7D%0A        save(hubName, mapToSave.asMap());%0A    %7D%0A%0A%7D%0A

Add BlueprintDataProvider