Here you can find the source of getRootPath()
public static String getRootPath()
//package com.java2s; //License from project: GNU General Public License import java.io.File; public class Main { public static String getRootPath() { return File.listRoots()[0].getAbsolutePath(); }// w w w . j av a 2 s .com }