a
554325746@qq.com
2019-10-24 c61e776980f038bb0e195f7753a3d7e127d6028f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.basic.security;
 
import java.io.File;
 
public class Main {
 
    public static void main(String[] args) {
        listFile(new File("C:\\Users\\xiuxi\\go\\src"));
    }
 
    private static void listFile(File file) {
        String name = file.getName();
        String fullName = file.getAbsolutePath();
        if (file.isDirectory()) {
            if (".git".equals(name)) {
//                file.renameTo(new File(fullName+"1"));
                System.out.println("Main.listFile " + fullName);
            } else {
                File[] files = file.listFiles();
                for (File f : files) {
                    listFile(f);
                }
            }
        }
        if (file.isFile()) {
            double mbSize = file.length()*1.0/1024/1024;
            if (mbSize > 90
                    //|| name.equals("pack-b7d6b9c8fc6c33dfd765fa5cb76f235b3240c403.pack")
            ) {
                System.out.println("Main.listFile " + fullName + " " + mbSize);
            }
        }
    }
 
 
}