Here you can find the source of isRootDir(String dir)
public static boolean isRootDir(String dir)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static String DIRECTORY_SEPARATOR = File.separator; public static boolean isRootDir(String dir) { return (dir.startsWith(DIRECTORY_SEPARATOR) || dir.indexOf(":") > 0);// Linux & Windows Root //$NON-NLS-1$ }/*from ww w .jav a2 s . c o m*/ }