use of org.batfish.coordinator.AnalysisMetadataMgr.AnalysisType in project batfish by batfish.
the class WorkMgr method listAnalyses.
/**
* Returns the Analysis names which exist in the container and match the {@link AnalysisType}
*
* @param containerName Container name
* @param analysisType {@link AnalysisType} requested
* @return {@link Set} of container names
*/
public SortedSet<String> listAnalyses(String containerName, AnalysisType analysisType) {
Path containerDir = getdirContainer(containerName);
Path analysesDir = containerDir.resolve(BfConsts.RELPATH_ANALYSES_DIR);
if (!Files.exists(analysesDir)) {
return ImmutableSortedSet.of();
}
SortedSet<String> analyses = CommonUtil.getSubdirectories(analysesDir).stream().map(subdir -> subdir.getFileName().toString()).filter(aName -> selectAnalysis(aName, analysisType, containerName)).collect(ImmutableSortedSet.toImmutableSortedSet(Comparator.naturalOrder()));
return analyses;
}
Aggregations