Tout dépend de ta version de Java. en 1.6 tu peux faire :
File f = new File("c:/");
// prints the volume size in bytes.
System.out.println(f.getTotalSpace());
// prints the total free bytes for the volume in bytes.
System.out.println(f.getFreeSpace());
// prints an accurate estimate of the total free (and available) bytes
// on the volume. This method may return the same result as 'getFreeSpace()' on
// some platforms.
System.out.println(f.getUsableSpace());
|