Class FileAttributesUtils
- java.lang.Object
-
- fr.paris.lutece.plugins.genericattributes.util.FileAttributesUtils
-
public final class FileAttributesUtils extends java.lang.ObjectUtility class of plugin generic attributes
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_MESSAGE_ERROR_UPLOADING_FILE_FILE_MAX_SIZEstatic java.lang.StringPROPERTY_MESSAGE_ERROR_UPLOADING_FILE_FILE_VALUEstatic java.lang.StringPROPERTY_MESSAGE_ERROR_UPLOADING_FILE_MAX_FILESstatic java.lang.StringPROPERTY_UPLOAD_FILE_DEFAULT_MAX_SIZE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcheckEntryData(javax.servlet.http.HttpServletRequest request, java.util.Locale locale)Check the entry datastatic java.lang.StringcheckEntryData(javax.servlet.http.HttpServletRequest request, java.util.Locale locale, java.lang.String errorReturnUrl)Check the entry datastatic GenericAttributeErrorcheckFileSize(Entry entry, java.util.List<org.apache.commons.fileupload.FileItem> listUploadedFileItems, java.util.List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload, java.util.Locale locale)static GenericAttributeErrorcheckNumberFiles(Entry entry, java.util.List<org.apache.commons.fileupload.FileItem> listUploadedFileItems, java.util.List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload, java.util.Locale locale)static GenericAttributeErrorcheckResponseData(Entry entry, java.util.List<org.apache.commons.fileupload.FileItem> listFilesSource, java.util.Locale locale)Check the record field datastatic voidcreateOrUpdateFileFields(Entry entry, javax.servlet.http.HttpServletRequest request)Set the list of fields
-
-
-
Field Detail
-
PROPERTY_MESSAGE_ERROR_UPLOADING_FILE_MAX_FILES
public static final java.lang.String PROPERTY_MESSAGE_ERROR_UPLOADING_FILE_MAX_FILES
- See Also:
- Constant Field Values
-
PROPERTY_MESSAGE_ERROR_UPLOADING_FILE_FILE_MAX_SIZE
public static final java.lang.String PROPERTY_MESSAGE_ERROR_UPLOADING_FILE_FILE_MAX_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_MESSAGE_ERROR_UPLOADING_FILE_FILE_VALUE
public static final java.lang.String PROPERTY_MESSAGE_ERROR_UPLOADING_FILE_FILE_VALUE
- See Also:
- Constant Field Values
-
PROPERTY_UPLOAD_FILE_DEFAULT_MAX_SIZE
public static final java.lang.String PROPERTY_UPLOAD_FILE_DEFAULT_MAX_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
checkFileSize
public static GenericAttributeError checkFileSize(Entry entry, java.util.List<org.apache.commons.fileupload.FileItem> listUploadedFileItems, java.util.List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload, java.util.Locale locale)
-
checkNumberFiles
public static GenericAttributeError checkNumberFiles(Entry entry, java.util.List<org.apache.commons.fileupload.FileItem> listUploadedFileItems, java.util.List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload, java.util.Locale locale)
-
checkEntryData
public static java.lang.String checkEntryData(javax.servlet.http.HttpServletRequest request, java.util.Locale locale)Check the entry data- Parameters:
request- the HTTP requestlocale- the locale- Returns:
- the error message url if there is an error, an empty string otherwise
-
checkEntryData
public static java.lang.String checkEntryData(javax.servlet.http.HttpServletRequest request, java.util.Locale locale, java.lang.String errorReturnUrl)Check the entry data- Parameters:
request- the HTTP requestlocale- the locale- Returns:
- the error message url if there is an error, an empty string otherwise
-
checkResponseData
public static GenericAttributeError checkResponseData(Entry entry, java.util.List<org.apache.commons.fileupload.FileItem> listFilesSource, java.util.Locale locale)
Check the record field data- Parameters:
entry- The entrylistFilesSource- the list of source files to uploadlocale- the locale- Returns:
- The error if there is any
-
createOrUpdateFileFields
public static void createOrUpdateFileFields(Entry entry, javax.servlet.http.HttpServletRequest request)
Set the list of fields- Parameters:
entry- The entryrequest- the HTTP request
-
-