List of utility methods to do Root Directory Get
File | getRoot() Returns the root location of the CraftBukkit server. return new File("."); |
String | getRoot() get Root if (root != null) root = new File("").getAbsolutePath(); return root; |
String | getRoot() get Root try { return new File("/").getCanonicalPath(); } catch (final IOException ex) { throw new RuntimeException(ex); |
String | getRoot() get Root return System.getProperty("user.dir") + String.format("%ssrc%stest%sfiles%s", File.separator, File.separator, File.separator, File.separator); |
File | getRoot() get Root System.out.print("Detecting OS... "); final String name = System.getProperty("os.name").toLowerCase(); File root; if (name.contains("win")) root = new File(System.getenv("APPDATA") + File.separator + ".minecraft"); else if (name.contains("mac")) root = new File( System.getProperty("user.home") + File.separator + "Library/Application Support/minecraft"); ... |
String | getRoot() get Root if (rootPath == null) { try { File rootDir = new File(ClassLoader.getSystemClassLoader().getResource(".").toURI().getPath()); rootPath = rootDir.getAbsolutePath(); if (rootPath.endsWith("bin")) { rootPath = rootPath.substring(0, rootPath.length() - "bin".length()); } else if (rootPath.endsWith("target" + File.separator + "classes")) { rootPath = rootPath.substring(0, ... |
File | getRoot(File child) get Root File root = null; File tmp = child; root = tmp; while (tmp != null) { root = tmp; tmp = tmp.getParentFile(); if ("\\\\".equals(root.getPath())) { ... |
File | getRoot(File file) get Root File parent = file; while (parent.getParentFile() != null) parent = parent.getParentFile(); return parent; |
File | getRoot(File file) get Root File tmp = file.getParentFile(); File rtn = null; for (; tmp != null; rtn = tmp, tmp = tmp.getParentFile()) ; return rtn; |
File | getRoot(File file, ArrayList get Root if (file != null && lst != null && lst.size() > 0) { for (File f : lst) { if (file.equals(f)) { return f; return getRoot(file.getParentFile(), lst); return null; |