|
|
|
@ -29,17 +29,17 @@ public class RarUtil {
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
// unrar("/tmp/20230301/201905962222/20230519153409_wuiol3vn.rar", "/Users/youyongsheng/Desktop/aa");
|
|
|
|
|
un7Z("/tmp/20230301/201905962241/20230519153506_i39sv5p2.7z", "/Users/youyongsheng/Desktop/aa");
|
|
|
|
|
// un7Z("/tmp/20230301/201905962241/20230519153506_i39sv5p2.7z", "/Users/youyongsheng/Desktop/aa");
|
|
|
|
|
|
|
|
|
|
// unzip();
|
|
|
|
|
// valid("/tmp/20230201");
|
|
|
|
|
removeFullCode("/tmp/20230302");
|
|
|
|
|
valid("/tmp/20230402");
|
|
|
|
|
// removeFullCode("/tmp/20230302");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void unzip(){
|
|
|
|
|
String sourceDir = "/tmp/20230301";
|
|
|
|
|
String targetDir = "/tmp/20230302";
|
|
|
|
|
String sourceDir = "/tmp/20230401";
|
|
|
|
|
String targetDir = "/tmp/20230402";
|
|
|
|
|
|
|
|
|
|
File directory = new File(sourceDir);
|
|
|
|
|
File[] studentDirs = directory.listFiles();
|
|
|
|
@ -71,12 +71,10 @@ public class RarUtil {
|
|
|
|
|
for (File zipFile : zipFiles) {
|
|
|
|
|
try {
|
|
|
|
|
if(zipFile.getName().endsWith(".zip")){
|
|
|
|
|
// unzip(zipFile.getAbsolutePath(), studentTargetDir);
|
|
|
|
|
unzip(zipFile.getAbsolutePath(), studentTargetDir);
|
|
|
|
|
}else if(zipFile.getName().endsWith(".rar")){
|
|
|
|
|
System.out.println(zipFile.getAbsolutePath() + " to " + targetDir);
|
|
|
|
|
unRar(zipFile.getAbsolutePath(), studentTargetDir);
|
|
|
|
|
}else{
|
|
|
|
|
System.out.println(zipFile.getAbsolutePath() + " to " + targetDir);
|
|
|
|
|
RarUtil.un7Z(zipFile.getAbsolutePath(), studentTargetDir);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -110,7 +108,11 @@ public class RarUtil {
|
|
|
|
|
for (File studentDir : studentDirs) {
|
|
|
|
|
if (studentDir.isDirectory()) {
|
|
|
|
|
|
|
|
|
|
for (File file : studentDir.listFiles()) {
|
|
|
|
|
File[] files = studentDir.listFiles();
|
|
|
|
|
if(files == null || files.length == 0){
|
|
|
|
|
System.out.println(studentDir.getName()+" -> null");
|
|
|
|
|
}
|
|
|
|
|
for (File file : files) {
|
|
|
|
|
System.out.println(studentDir.getName()+" ->" + file.getName());
|
|
|
|
|
}
|
|
|
|
|
System.out.println("--------------------------------");
|
|
|
|
|