feat: file module support i18n message
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user