java.nio.file.InvalidPathException: Illegal char <*> at index 24: src\test\resources\moco\*.json
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at com.github.dreamhead.moco.util.Globs.getGlobPath(Globs.java:31)
at com.github.dreamhead.moco.util.Globs.glob(Globs.java:20)
at com.github.dreamhead.moco.parser.model.GlobalSetting.includes(GlobalSetting.java:22)
现象:
问题分析: GlobalSetting.includes -> Globs.glob -> Globs.getGlobPath -> Paths.get 方法在验证文件名时: *号为非法符号.
处理建议: 修改 Globs.glob方法, 不用Path做路径分析, 手动解析字符串实现searchPath的功能