/**
* 针对路径中 存在的特殊字符 [ \/:*?"<>|] ,转换为其他字符
* @param dirPath 文件路径
* @param replaceStr 备选的其他字符
* @return 返回转换后的路径
* @throws Exception
*/
public static String convertPath(String dirPath, String replaceStr)throws Exception {
dirPath = dirPath.replaceAll("[/\\\\:*?|\"<>]", replaceStr);
return dirPath ;
}
路径转换。。
最新推荐文章于 2022-01-25 18:33:39 发布