[mycontainer] r836 committed - [No log message]

0 views
Skip to first unread message

mycon...@googlecode.com

unread,
Jun 26, 2011, 6:53:19 PM6/26/11
to mycontain...@googlegroups.com
Revision: 836
Author: fuw...@gmail.com
Date: Sun Jun 26 15:52:18 2011
Log: [No log message]
http://code.google.com/p/mycontainer/source/detail?r=836

Modified:

/trunk/devel/implementation/mycontainer-components/mycontainer-commons/src/main/java/org/mycontainer/commons/file/PathUtil.java

=======================================
---
/trunk/devel/implementation/mycontainer-components/mycontainer-commons/src/main/java/org/mycontainer/commons/file/PathUtil.java
Sun Jun 26 07:16:17 2011
+++
/trunk/devel/implementation/mycontainer-components/mycontainer-commons/src/main/java/org/mycontainer/commons/file/PathUtil.java
Sun Jun 26 15:52:18 2011
@@ -53,11 +53,15 @@
}

public static String concatPath(String path, String child) {
+ if (path.endsWith("/")) {
+ path = path.substring(0, path.length() - 1);
+ }
+ if (child.startsWith("/")) {
+ child = child.substring(1);
+ }
StringBuilder sb = new StringBuilder(path.length() + child.length() + 1);
sb.append(path);
- if (!path.endsWith("/")) {
- sb.append('/');
- }
+ sb.append('/');
sb.append(child);
return sb.toString();
}

Reply all
Reply to author
Forward
0 new messages