Improve StringUtils.cleanPath

Issue: SPR-11793
This commit is contained in:
Rossen Stoyanchev
2014-05-15 17:26:52 -04:00
parent 3bdf8aefa9
commit 8ee4651038
2 changed files with 8 additions and 1 deletions

View File

@@ -622,7 +622,12 @@ public abstract class StringUtils {
String prefix = "";
if (prefixIndex != -1) {
prefix = pathToUse.substring(0, prefixIndex + 1);
pathToUse = pathToUse.substring(prefixIndex + 1);
if (prefix.contains("/")) {
prefix = "";
}
else {
pathToUse = pathToUse.substring(prefixIndex + 1);
}
}
if (pathToUse.startsWith(FOLDER_SEPARATOR)) {
prefix = prefix + FOLDER_SEPARATOR;