Java Utililty Methods is Root File

List of utility methods to do is Root File

Description

The list of methods to do is Root File are organized into topic(s).

Method

booleanisRoot()
is Root
if (isUnix()) {
    return "root".equals(getUsername());
} else {
    return "Administrator".equals(getUsername());
booleanisRoot(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;
booleanisRootDir(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;
booleanisRootDir(String dir)
is Root Dir
return (dir.startsWith(DIRECTORY_SEPARATOR) || dir.indexOf(":") > 0);
booleanisRootOfSeqWare(File workingDirectory)
is Root Of Seq Ware
String[] list = workingDirectory.list();
for (String file : list) {
    if (file.contains("seqware-distribution")) {
        return true;
return false;
booleanisRootPath(File file)
is Root Path
return (file.getAbsoluteFile().getParentFile() == null) ? true : false;