根据文件名的上一级目录分组,key是父级目录名称

Map<String,List<Path>> pathMap = exceptionReport.stream()
        .map(item -> Paths.get(item.getParamValue()))
        .collect(Collectors.groupingBy(item -> item.getParent().getFileName().toString(),Collectors.toList()));
posted @ 2022-06-27 17:52  ivyJ  阅读(24)  评论(0)    收藏  举报