You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/12/10 10:18:18 UTC
svn commit: r1044249 -
/camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java
Author: davsclaus
Date: Fri Dec 10 09:18:18 2010
New Revision: 1044249
URL: http://svn.apache.org/viewvc?rev=1044249&view=rev
Log:
Fixed normalize file path on Windows.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java?rev=1044249&r1=1044248&r2=1044249&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java Fri Dec 10 09:18:18 2010
@@ -42,14 +42,17 @@ public final class FileUtil {
* Normalizes the path to cater for Windows and other platforms
*/
public static String normalizePath(String path) {
- if (path != null && isWindows() && path.indexOf('/') >= 0) {
+ if (path == null) {
+ return null;
+ }
+
+ if (isWindows()) {
// special handling for Windows where we need to convert / to \\
return path.replace('/', '\\');
- } else if (path != null && path.indexOf('\\') >= 0) {
+ } else {
// for other systems make sure we use / as separators
return path.replace('\\', '/');
}
- return path;
}
public static boolean isWindows() {