替换路径中的相对路径为横杆(如: file/../f/替换为file/-/f/) @param path 路径
(String path)
| 383 | * @param path 路径 |
| 384 | */ |
| 385 | public static String toRelativePath(String path){ |
| 386 | String systemPath = ""; |
| 387 | if(path != null && !path.trim().isEmpty()){ |
| 388 | systemPath = Strings.CS.replace(path, "..", "-"); |
| 389 | systemPath = Strings.CS.replace(systemPath, "%", "-");//百分号替换为横杆 |
| 390 | } |
| 391 | return systemPath; |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * 系统路径转为下划线(如: file/f/f/转为file_f_f_) |
no test coverage detected