class MultiRepositoryManager {

    void initializeRepositoryListForMultiRepositoryAndReconfigureFactory(List<RepositoryProperties> repositoryList) {
        ObjectMapper objectMapper = new ObjectMapper();
        File repositoryConfiguration = new File(Environments.getInstance().getRepositoryConfig().getRepositoryRoot(), Filename.FILENAME_JSON_REPOSITORIES);
        if (!repositoryConfiguration.exists()) {
            try {
                Files.createFile(repositoryConfiguration.toPath());
                objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
                objectMapper.writeValue(repositoryConfiguration, repositoryList);
            } catch (IOException exception) {
                exception.printStackTrace();
            }
            createMultiRepositoryFileStructure(Paths.get(Environments.getInstance().getRepositoryConfig().getRepositoryRoot()),
                Paths.get(Environments.getInstance().getRepositoryConfig().getRepositoryRoot(), Constants.DEFAULT_LOCAL_REPO_NAME));
        }
        try {
            RepositoryFactory.reconfigure();
        } catch (Exception e) {
            LOGGER.debug("Error reconfiguring the RepositoryFactory.", e);
        }
    }

}