admin
2022-10-28 0e9b6603d4ae9d11c1fbc90257ce816c5807b8ff
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package test;
 
import com.qcloud.cmq.Account;
import com.qcloud.cmq.Queue;
import com.qcloud.cmq.entity.CmqResponse;
import org.yeshi.utils.FileUtil;
 
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
 
/**
 * @author hxh
 * @title: Test
 * @description: TODO
 * @date 2022/6/6 18:53
 */
public class Test {
 
    public static void main(String[] args) throws IOException {
//        if(1>0){
//            test1();
//            return;
//        }
        String dir = "C:\\Users\\Administrator\\Desktop\\ocr\\number_trade";
        File[] fs = new File(dir).listFiles();
        Set<String> md5Set = new HashSet<>();
        for (File f : fs) {
            if (f.isDirectory()) {
                continue;
            }
            String md5 = FileUtil.getFileMD5(f);
            if (md5Set.contains(md5)) {
                f.delete();
            } else {
                md5Set.add(md5);
            }
        }
    }
 
 
    private static void test1() throws Exception{
 
    }
 
 
}