Java Path Normalize normalizePath(String path)

Here you can find the source of normalizePath(String path)

Description

normalize Path

License

Open Source License

Declaration

public static String normalizePath(String path) 

Method Source Code

//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;
    }
}

Related

  1. normalizePath(String path)
  2. normalizePath(String path)
  3. normalizePath(String path)
  4. normalizePath(String path)
  5. normalizePath(String path)
  6. normalizePath(String path)
  7. normalizePath(String path)
  8. normalizePath(String path)
  9. normalizePath(String path)