|
@@ -236,18 +236,20 @@ public class ToolUtil {
|
|
|
* @param path 待修正的路径
|
|
|
* @return 修正后的路径
|
|
|
*/
|
|
|
- public static String path(String path){
|
|
|
+ public static String path(String path) {
|
|
|
String p = StringUtils.replace(path, "\\", "/");
|
|
|
p = StringUtils.join(StringUtils.split(p, "/"), "/");
|
|
|
- if (!StringUtils.startsWithAny(p, "/") && StringUtils.startsWithAny(path, "\\", "/")){
|
|
|
+ if (!StringUtils.startsWithAny(p, "/") && StringUtils.startsWithAny(path, "\\", "/")) {
|
|
|
p += "/";
|
|
|
}
|
|
|
- if (!StringUtils.endsWithAny(p, "/") && StringUtils.endsWithAny(path, "\\", "/")){
|
|
|
- p = p + "/";
|
|
|
- }
|
|
|
- if (path != null && path.startsWith("/")){
|
|
|
+// if (!StringUtils.endsWithAny(p, "/") && StringUtils.endsWithAny(path, "\\", "/")) {
|
|
|
+// p = p;//+ "/";
|
|
|
+// }
|
|
|
+ if (path != null && path.startsWith("/")) {
|
|
|
p = "/" + p; // linux下路径
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
return p;
|
|
|
}
|
|
|
|