}
private static String trimLastPath(String originalPath) {
+ if(StringUtil.isEmpty(originalPath)) {
+ return StringUtil.EMPTY_STRING;
+ }
+
char lastChar = originalPath.charAt(originalPath.length() - 1);
if(lastChar == File.separatorChar) {
return originalPath.substring(0, originalPath.length() - 1);
}
private static String trimFirstPath(String originalPath) {
+ if(StringUtil.isEmpty(originalPath)) {
+ return StringUtil.EMPTY_STRING;
+ }
+
char firstChar = originalPath.charAt(0);
if(firstChar != File.separatorChar) {
return ("" + File.separatorChar).concat(originalPath);