import java.io.File; public class ShowFreeSpace { public static void main(final String[] args) throws Exception { File file = new File(args[0]); System.out.printf("total space : %,d [byte]%n", file.getTotalSpace()); System.out.printf("free space : %,d [byte]%n", file.getFreeSpace()); System.out.printf("usable space: %,d [byte]%n", file.getUsableSpace()); } }