feat: file module support i18n message

This commit is contained in:
zhangsz committed 2025-01-22 10:40:02 +08:00
1 parent 96bd946635
commit 575e101082
4 files changed
+8 -1

No files matched your search

@@ -11,6 +11,7 @@ import org.wfc.common.core.exception.file.FileNameLengthLimitExceededException;
import org.wfc.common.core.exception.file.FileSizeLimitExceededException;
import org.wfc.common.core.exception.file.InvalidExtensionException;
import org.wfc.common.core.utils.DateUtils;
import org.wfc.common.core.utils.MessageUtils;
import org.wfc.common.core.utils.StringUtils;
import org.wfc.common.core.utils.file.FileTypeUtils;
import org.wfc.common.core.utils.file.MimeTypeUtils;
@@ -66,7 +67,7 @@ public class FileUploadUtils {
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
InvalidExtensionException {
if (file == null || file.isEmpty()) {
throw new IllegalArgumentException("File must not be null or empty");
throw new IllegalArgumentException(MessageUtils.message("file.cannot.null"));
}
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {