Java Root Directory Get getRootDir()

Here you can find the source of getRootDir()

Description

get Root Dir

License

Open Source License

Declaration

public static File getRootDir() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {

    public static File getRootDir() {
        String os = System.getProperty("os.name").toUpperCase();
        if (os.contains("WIN")) {
            return new File(System.getenv("APPDATA"), "routeKIT");
        } else if (os.contains("MAC")) {
            return new File(new File(new File(System.getProperty("user.home"), "Library"), "Application Support"),
                    "routeKIT");
        } else if (os.matches(".*N[IU]X.*")) {
            return new File(new File(System.getProperty("user.home"), ".config"), "routeKIT");
        } else {//w w  w  .ja v  a2 s .com
            throw new RuntimeException("Unknown operating system " + os);
        }
    }
}

Related

  1. getRoot(String path)
  2. getRootDir()
  3. getRootDir()
  4. getRootDir()
  5. getRootDir()
  6. getRootDir()
  7. getRootDir()
  8. getRootDirectory()
  9. getRootDirectoryOf(String referenceFile, String rootMark)