Here you can find the source of getRootPath()
public static String getRootPath()
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { public static String getRootPath() { return getPath(); }/*ww w .j a v a 2 s .co m*/ public static String getPath(String x) { String path = ""; try { File file = new File("."); path = file.getCanonicalPath() + "\\" + x + "\\"; } catch (IOException e) { System.out.println("com.job5156.util.FileUtil getPath() error :" + e.getMessage()); } return path; } public static String getPath() { String path = ""; File file = new File("."); try { path = file.getCanonicalPath(); } catch (IOException e) { e.printStackTrace(); } return path; } }