@CommonEager public class PathUtil extends Object
| 构造器和说明 |
|---|
PathUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<Path> |
getConditionList(List<Path> pathList,
PathCondition pathCondition)
获取满足条件的列表
|
static Path |
getParentPath(Path path)
获取父类路径,避免返回 null
1.
|
static List<Path> |
getParentPaths(Path path)
获取所有的父类路径
1.
|
static Path |
getPublicParentPath(List<Path> pathList)
获取共有的路径
|
static String |
getRelativePath(Path parentPath,
Path path)
获取 path 相对于 parentPath 剩余的路径
和
Path.relativize(Path) 不同,这个结果更加直观。 |
static List<String> |
retainAll(List<List<String>> collectionList)
获取所有集合的交集
1.
|
static List<String> |
toStringList(List<?> pathList)
对象列表转换为 toString 列表
1.
|
public static List<Path> getConditionList(List<Path> pathList, PathCondition pathCondition)
pathList - 路径pathCondition - 条件public static String getRelativePath(Path parentPath, Path path)
Path.relativize(Path) 不同,这个结果更加直观。不过性能一般。parentPath - 父类路径path - 原始路径public static Path getPublicParentPath(List<Path> pathList)
pathList - 路径列表public static List<Path> getParentPaths(Path path)
path - 当前路径public static Path getParentPath(Path path)
path - 路径public static List<String> toStringList(List<?> pathList)
pathList - 原始对象Copyright © 2019. All rights reserved.