Java File.getTotalSpace()

Syntax

File.getTotalSpace() has the following syntax.

public long getTotalSpace()

Example

In the following code shows how to use File.getTotalSpace() method.


/*from  www . j a  v a2 s . com*/
import java.io.File;

public class Main {
  public static void main(String[] args) throws Exception {

    // create new files
    File f = new File("c:/");


    System.out.print(f.getTotalSpace());

  }
}

The code above generates the following result.