Java tutorial
//package com.java2s; public class Main { /** * Convert a Cygwin based path to Windows format e.g. /cygdrive/c/file.txt * to C:\\file.txt * @param cygPath Cygwin based path * @return Windows path */ public static String toWindowsPath(String cygPath) { StringBuilder sb = new StringBuilder(); sb.append(cygPath.charAt(10)).append(":\\"); if (cygPath.length() > 12) { sb.append(cygPath.substring(12)); } return sb.toString(); } }