文件名重复问题修复
parent
67f30d793d
commit
bbde8cdb2a
|
@ -380,6 +380,8 @@ public class Warden {
|
||||||
String fileName = file.getName();
|
String fileName = file.getName();
|
||||||
if (fileNames.contains(fileName)){
|
if (fileNames.contains(fileName)){
|
||||||
fileName = (random.nextInt(90000) + 10000) + fileName;
|
fileName = (random.nextInt(90000) + 10000) + fileName;
|
||||||
|
} else {
|
||||||
|
fileNames = fileNames + fileName + ",";
|
||||||
}
|
}
|
||||||
ZipEntry zipEntry = new ZipEntry(fileName);
|
ZipEntry zipEntry = new ZipEntry(fileName);
|
||||||
zipOut.putNextEntry(zipEntry);
|
zipOut.putNextEntry(zipEntry);
|
||||||
|
|
Loading…
Reference in New Issue