mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 11:58:01 +08:00
测试
This commit is contained in:
parent
c9f6c80e44
commit
cb251db69d
@ -19,25 +19,7 @@ public class DTest {
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
File[] files = File.listRoots();
|
||||
long freeSpace = 0;
|
||||
long useAbleSpace = 0;
|
||||
long totalSpace = 0;
|
||||
for (File file : files) {
|
||||
long free = file.getFreeSpace();
|
||||
freeSpace += free;
|
||||
long total = file.getTotalSpace();
|
||||
totalSpace += total;
|
||||
useAbleSpace += total - free;
|
||||
System.out.println(file.getPath());
|
||||
System.out.println(FileUtil.readableFileSize(free));
|
||||
System.out.println(FileUtil.readableFileSize(total - free));
|
||||
System.out.println(FileUtil.readableFileSize(total));
|
||||
System.out.println("-------------------------");
|
||||
}
|
||||
System.out.println(FileUtil.readableFileSize(freeSpace));
|
||||
System.out.println(FileUtil.readableFileSize(useAbleSpace));
|
||||
System.out.println(FileUtil.readableFileSize(totalSpace));
|
||||
|
||||
}
|
||||
|
||||
private static void printTrack() {
|
||||
|
Loading…
Reference in New Issue
Block a user