Example usage for java.io File listRoots

List of usage examples for java.io File listRoots

Introduction

In this page you can find the example usage for java.io File listRoots.

Prototype

public static File[] listRoots() 

Source Link

Document

List the available filesystem roots.

Usage

From source file:Main.java

public static void main(String[] args) {
    File[] drives = File.listRoots();
    for (int i = 0; i < drives.length; i++) {
        System.out.println(drives[i]);
    }//from  www. ja v a 2 s.co  m
}

From source file:Main.java

public static void main(String[] args) {
    File[] roots = File.listRoots();
    System.out.println("List  of  root directories:");
    for (File f : roots) {
        System.out.println(f.getPath());
    }/*from  w  w w  .  j av  a 2 s.c om*/
}

From source file:MainClass.java

public static void main(String[] args) {

    File[] roots = File.listRoots();
    for (int i = 0; i < roots.length; i++) {
        System.out.println(roots[i]);
    }//  w w  w.  ja v a 2  s. c om
}

From source file:PartitionSpace.java

public static void main(String[] args) {
    File[] roots = File.listRoots();
    for (int i = 0; i < roots.length; i++) {
        System.out.println("Partition: " + roots[i]);
        System.out.println("Usable space on this partition = " + roots[i].getUsableSpace());
    }//from  w  w w  .  j  a  v a2s . c o  m
}

From source file:PartitionSpace.java

public static void main(String[] args) {
    File[] roots = File.listRoots();
    for (int i = 0; i < roots.length; i++) {
        System.out.println("Partition: " + roots[i]);
        System.out.println("Total space on this partition = " + roots[i].getTotalSpace());
    }/*w  w  w  .ja v  a2  s  .  c o m*/
}

From source file:PartitionSpace.java

public static void main(String[] args) {
    File[] roots = File.listRoots();
    for (int i = 0; i < roots.length; i++) {
        System.out.println("Partition: " + roots[i]);
        System.out.println("Free space on this partition = " + roots[i].getFreeSpace());
    }//from  w ww.  j  a  va  2s.  c o  m
}

From source file:SpaceChecker.java

public static void main(String[] args) {
    File[] roots = File.listRoots();

    for (int i = 0; i < roots.length; i++) {
        System.out.println(roots[i]);
        System.out.println("Free space = " + roots[i].getFreeSpace());
        System.out.println();//from  w w  w  .  ja v  a  2 s . c  o  m
    }
}

From source file:SpaceChecker.java

public static void main(String[] args) {
    File[] roots = File.listRoots();

    for (int i = 0; i < roots.length; i++) {
        System.out.println(roots[i]);
        System.out.println("Total space = " + roots[i].getTotalSpace());
        System.out.println();/*  www . ja  va2 s.  c  o m*/
    }
}

From source file:SpaceChecker.java

public static void main(String[] args) {
    File[] roots = File.listRoots();

    for (int i = 0; i < roots.length; i++) {
        System.out.println(roots[i]);
        System.out.println("Usable space = " + roots[i].getUsableSpace());
        System.out.println();//w  ww .  j  av  a 2s  .c  om
    }
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    File[] roots = File.listRoots();
    for (int i = 0; i < roots.length; i++) {
        System.out.println(roots[i]);
    }/*ww  w  .jav a  2  s. c o  m*/
}