<dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.6</version> </dependency>
此处获取C盘Tools文件夹大小
public void getSize() { long size = FileUtils.sizeOfDirectory(new File("C:/Tools")); System.out.println("Size: " + size + " bytes"); }