public class UploadFileValidator extends Object implements org.springframework.validation.Validator
UploadFileValidator class.
| Constructor and Description |
|---|
UploadFileValidator()
Constructor for UploadFileValidator.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getExtension(String name)
getExtension.
|
FileService |
getFileService()
Getter for the field
fileService. |
FileTypeService |
getFileTypeService()
Getter for the field
fileTypeService. |
void |
setFileService(FileService fileService)
Setter for the field
fileService. |
void |
setFileTypeService(FileTypeService fileTypeService)
Setter for the field
fileTypeService. |
boolean |
supports(Class clazz) |
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Validates the specified Object.
|
void |
validateExists(org.springframework.web.multipart.MultipartFile file,
String folderStore,
org.springframework.validation.Errors errors)
validateExists.
|
boolean |
validateExtension(String fileName,
String nameField,
Integer fileTypeId,
org.springframework.validation.Errors errors)
validateExtension.
|
boolean |
validateProtocol(String strUrl,
String[] trueProtocols,
org.springframework.validation.Errors errors)
validateProtocol.
|
public UploadFileValidator()
Constructor for UploadFileValidator.
public boolean supports(Class clazz)
supports in interface org.springframework.validation.Validatorclazz - public void validate(Object obj, org.springframework.validation.Errors errors)
validate in interface org.springframework.validation.Validatorobj - errors - public boolean validateProtocol(String strUrl, String[] trueProtocols, org.springframework.validation.Errors errors)
validateProtocol.
public boolean validateExtension(String fileName, String nameField, Integer fileTypeId, org.springframework.validation.Errors errors)
validateExtension.
public void validateExists(org.springframework.web.multipart.MultipartFile file,
String folderStore,
org.springframework.validation.Errors errors)
validateExists.
file - a MultipartFile object.folderStore - a String object.errors - a Errors object.public FileService getFileService()
Getter for the field fileService.
FileService object.public void setFileService(FileService fileService)
Setter for the field fileService.
fileService - a FileService object.public FileTypeService getFileTypeService()
Getter for the field fileTypeService.
FileTypeService object.public void setFileTypeService(FileTypeService fileTypeService)
Setter for the field fileTypeService.
fileTypeService - a FileTypeService object.Copyright © 2015 SeqWare. All rights reserved.