private static ProjectRepositories processStream(InputStream is) throws IOException { WsProjectResponse response = WsProjectResponse.parseFrom(is); if (response.getFileDataByModuleAndPathCount() == 0) { return new SingleProjectRepository(constructFileDataMap(response.getFileDataByPathMap()), new Date(response.getLastAnalysisDate())); } else { final Map<String, SingleProjectRepository> repositoriesPerModule = new HashMap<>(); response.getFileDataByModuleAndPathMap().keySet().forEach(moduleKey -> { WsProjectResponse.FileDataByPath filePaths = response.getFileDataByModuleAndPathMap().get(moduleKey); repositoriesPerModule.put(moduleKey, new SingleProjectRepository( constructFileDataMap(filePaths.getFileDataByPathMap()), new Date(response.getLastAnalysisDate()))); }); return new MultiModuleProjectRepository(repositoriesPerModule, new Date(response.getLastAnalysisDate())); } }
private static ProjectRepositories processStream(InputStream is) throws IOException { WsProjectResponse response = WsProjectResponse.parseFrom(is); if (response.getFileDataByModuleAndPathCount() == 0) { return new SingleProjectRepository(constructFileDataMap(response.getFileDataByPathMap()), new Date(response.getLastAnalysisDate())); } else { final Map<String, SingleProjectRepository> repositoriesPerModule = new HashMap<>(); response.getFileDataByModuleAndPathMap().keySet().forEach(moduleKey -> { WsProjectResponse.FileDataByPath filePaths = response.getFileDataByModuleAndPathMap().get(moduleKey); repositoriesPerModule.put(moduleKey, new SingleProjectRepository( constructFileDataMap(filePaths.getFileDataByPathMap()), new Date(response.getLastAnalysisDate()))); }); return new MultiModuleProjectRepository(repositoriesPerModule, new Date(response.getLastAnalysisDate())); } }