# HG changeset patch # User Ed Swartz # Date 1260370875 21600 # Node ID fb206b3e6ddab3a8bd2bbb7f95c7097a3db0b8f3 # Parent 7f614450f806797242ad9272d693a4baca5bf649 Add utility used in EpocEnginHelper diff -r 7f614450f806 -r fb206b3e6dda core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/HostOS.java --- a/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/HostOS.java Wed Dec 09 09:00:20 2009 -0600 +++ b/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/HostOS.java Wed Dec 09 09:01:15 2009 -0600 @@ -96,8 +96,23 @@ } /** + * Convert a path which may be in the opposite slash format to the local slash format. + * NOTE: we assume that the path is already a legal path, + * but just with the wrong slash. + * @param file + * @return converted string + */ + public static String convertPathToNative(String path) { + if (path == null) return null; + if (IS_UNIX) + return path.replaceAll("\\\\", "/"); + else + return path.replaceAll("/", "\\\\"); + } + + /** * Create an IPath from a string which may be a Win32 path.

- * (This won't work in Unix when using a Win32 path.) + * ("new Path(...)" won't work in Unix when using a Win32 path.) * @param path * @return converted string */