* @return the relative path\r
*/\r
public static String getRelativePath(String basePath, String fullPath) {\r
- String relativePath = fullPath.substring(basePath.length()).replace('\\', '/');\r
- if (relativePath.charAt(0) == '/') {\r
- relativePath = relativePath.substring(1);\r
+ String bp = basePath.replace('\\', '/').toLowerCase();\r
+ String fp = fullPath.replace('\\', '/').toLowerCase();\r
+ if (fp.startsWith(bp)) {\r
+ String relativePath = fullPath.substring(basePath.length()).replace('\\', '/');\r
+ if (relativePath.charAt(0) == '/') {\r
+ relativePath = relativePath.substring(1);\r
+ }\r
+ return relativePath;\r
}\r
- return relativePath;\r
+ return fullPath;\r
}\r
\r
/**\r