Java Root Directory Get getRoot(File file)

Here you can find the source of getRoot(File file)

Description

get Root

License

Open Source License

Declaration

public static File getRoot(File file) 

Method Source Code

//package com.java2s;

import java.io.File;

public class Main {

    public static File getRoot(File file) {
        File tmp = file.getParentFile();
        File rtn = null;//from  w ww . j a v  a2  s .c o  m
        for (; tmp != null; rtn = tmp, tmp = tmp.getParentFile())
            ;
        return rtn;
    }
}

Related

  1. getRoot()
  2. getRoot()
  3. getRoot()
  4. getRoot(File child)
  5. getRoot(File file)
  6. getRoot(File file, ArrayList lst)
  7. getRoot(final File workingDirectory)
  8. getRoot(final String path)
  9. getRoot(String path)