Here you can find the source of cleanPath(String path)
Parameter | Description |
---|---|
path | - string with directory/file path |
public static String cleanPath(String path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*from w ww.j av a 2 s. co m*/ * cleanPath static method replaces all path separators with system dependednt value. * For UNIX it is / for Windows - "\\" * @param path - string with directory/file path * @return String path with system related path separators */ public static String cleanPath(String path) { String str = path.replace('/', File.separatorChar); String final_str = str.replace('\\', File.separatorChar); return final_str; } }