mirror of https://github.com/halo-dev/halo
😢 修复无备份时,备份页面异常的问题
parent
18a60f07f1
commit
3c1f251b88
|
@ -124,18 +124,20 @@ public class HaloUtils {
|
||||||
List<BackupDto> backupDtos = new ArrayList<>();
|
List<BackupDto> backupDtos = new ArrayList<>();
|
||||||
BackupDto backupDto = null;
|
BackupDto backupDto = null;
|
||||||
//遍历文件
|
//遍历文件
|
||||||
for (File file : files) {
|
if(null != files){
|
||||||
if (file.isFile()) {
|
for (File file : files) {
|
||||||
if (StringUtils.equals(file.getName(), ".DS_Store")) {
|
if (file.isFile()) {
|
||||||
continue;
|
if (StringUtils.equals(file.getName(), ".DS_Store")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
backupDto = new BackupDto();
|
||||||
|
backupDto.setFileName(file.getName());
|
||||||
|
backupDto.setCreateAt(getCreateTime(file.getAbsolutePath()));
|
||||||
|
backupDto.setFileType(FileUtil.getType(file));
|
||||||
|
backupDto.setFileSize(parseSize(file.length()));
|
||||||
|
backupDto.setBackupType(dir);
|
||||||
|
backupDtos.add(backupDto);
|
||||||
}
|
}
|
||||||
backupDto = new BackupDto();
|
|
||||||
backupDto.setFileName(file.getName());
|
|
||||||
backupDto.setCreateAt(getCreateTime(file.getAbsolutePath()));
|
|
||||||
backupDto.setFileType(FileUtil.getType(file));
|
|
||||||
backupDto.setFileSize(parseSize(file.length()));
|
|
||||||
backupDto.setBackupType(dir);
|
|
||||||
backupDtos.add(backupDto);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return backupDtos;
|
return backupDtos;
|
||||||
|
|
Loading…
Reference in New Issue