Here you can find the source of normalizePath(String path)
public static String normalizePath(String path)
//package com.java2s; /*//from ww w.j a va 2 s. c o m * Utility.cs * Copyright ? 2010-2011 kbinani, HAL * * This file is part of org.kbinani.cadencii. * * org.kbinani.cadencii is free software; you can redistribute it and/or * modify it under the terms of the GPLv3 License. * * org.kbinani.cadencii is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ public class Main { public static String normalizePath(String path) { if (path.indexOf("~") >= 0) { String usr = System.getProperty("user.name"); String tild = "/Users/" + usr; path = path.replace("~", tild); } path = path.replace("\\", "\\\\\\\\"); return path; } }