260311_02_ENH: 업로드 후 업로드 파일 삭제 적용
This commit is contained in:
@@ -79,6 +79,8 @@ public class UploadService {
|
||||
errorFile = toXlsx(failRows);
|
||||
}
|
||||
|
||||
dataFileService.deleteListFile(dataFilePath.getFileName().toString());
|
||||
|
||||
return ExcelUploadResultDto.of(total.get(), success.get(), fail.get(), errorFile);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,4 +33,14 @@ public class DataFileService extends AbstractFileService {
|
||||
throw BusinessException.internalError("FAIL_DATA_UPLOAD", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteListFile(String fileName) {
|
||||
Path dir = getBaseDir().toAbsolutePath().normalize();
|
||||
|
||||
try {
|
||||
deleteFile(dir, fileName);
|
||||
} catch (IOException e) {
|
||||
throw BusinessException.internalError("FAIL_DATA_DELETE", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user