Here you can find the source of makePath(File cwd, String path)
public static String makePath(File cwd, String path)
//package com.java2s; //License from project: GNU General Public License import java.io.File; public class Main { public static String makePath(File cwd, String path) { String prefix = "", suffix = ""; if (path.startsWith("jar:file:")) { prefix = "jar:file:"; int exclamation = path.indexOf('!'); suffix = path.substring(exclamation); path = path.substring(prefix.length(), exclamation); }/* w ww . ja v a2 s . c om*/ if (isAbsolutePath(path)) return prefix + path + suffix; if (path.equals(".")) return prefix + cwd.toString() + suffix; if (cwd.toString().equals(".")) return prefix + (path.equals("") ? "." : path) + suffix; return prefix + new File(cwd, path).toString() + suffix; } public static boolean isAbsolutePath(String path) { boolean isWindows = getPlatform().startsWith("win"); if (isWindows) return path.length() > 1 && path.charAt(1) == ':'; return path.startsWith("/"); } public static String getPlatform() { boolean is64bit = System.getProperty("os.arch", "").indexOf("64") >= 0; String osName = System.getProperty("os.name", "<unknown>"); if (osName.equals("Linux")) return "linux" + (is64bit ? "64" : "32"); if (osName.equals("Mac OS X")) return "macosx"; if (osName.startsWith("Windows")) return "win" + (is64bit ? "64" : "32"); //System.err.println("Unknown platform: " + osName); return osName.toLowerCase(); } }