Here you can find the source of cleanPath(String path)
Parameter | Description |
---|---|
path | a parameter |
public static String cleanPath(String path)
//package com.java2s; //License from project: LGPL public class Main { /**//from w w w . ja va 2 s. co m * clean path, remove double "/" and replace "\" by "/" * * @param path * @return "//web/path" >> "/web/path" */ public static String cleanPath(String path) { if (path == null) { return null; } else { path = path.replace('\\', '/'); while (path.indexOf("//") >= 0) { path = path.replace("//", "/"); } return path; } } }