Here you can find the source of normalizePath(String path)
private static String normalizePath(String path)
//package com.java2s; //License from project: Open Source License public class Main { private static int _isWindows = -1; private static String normalizePath(String path) { if (path.length() == 2 && path.charAt(1) == ':') { path += "/"; }/*from ww w . ja v a 2 s .c o m*/ if (isWindows()) { path = path.replace('/', '\\'); } return path; } public static boolean isWindows() { if (_isWindows == -1) { String osName = System.getProperty("os.name"); _isWindows = osName.toLowerCase().startsWith("windows") ? 1 : 0; } return _isWindows == 1; } }