Here you can find the source of formatPath(String path)
public static String formatPath(String path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String formatPath(String path) { if (path.contains("/")) { path = path.replace("/", File.separator); }//from ww w . j a v a 2 s . c om if (path.contains("\\")) { path = path.replace("/", File.separator); } return path; } }