Here you can find the source of getRootDir()
public static String getRootDir()
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static final String USER_DIR = "user.dir"; /**//from w ww .j a va 2 s . com * Get root directory for current work directory * * @return */ public static String getRootDir() { String userDir = System.getProperty(USER_DIR); String rootDir = userDir.substring(0, userDir.indexOf(File.separator) + 1); if (!rootDir.endsWith(File.separator)) { rootDir += File.separator; } return rootDir; } }