List of utility methods to do is Root File
boolean | isRoot() is Root if (isUnix()) { return "root".equals(getUsername()); } else { return "Administrator".equals(getUsername()); |
boolean | isRoot(File file) Returns whether the given folder is a root folder. File[] roots = File.listRoots(); for (File root : roots) if (file.equals(root)) return true; return false; |
boolean | isRootDir(File dir) Check if dir is a root directory if (!dir.isDirectory()) { return false; File[] roots = File.listRoots(); for (File root : roots) { if (root.equals(dir)) { return true; return false; |
boolean | isRootDir(String dir) is Root Dir return (dir.startsWith(DIRECTORY_SEPARATOR) || dir.indexOf(":") > 0); |
boolean | isRootOfSeqWare(File workingDirectory) is Root Of Seq Ware String[] list = workingDirectory.list(); for (String file : list) { if (file.contains("seqware-distribution")) { return true; return false; |
boolean | isRootPath(File file) is Root Path return (file.getAbsoluteFile().getParentFile() == null) ? true : false;
|