Class FileAttributesUtils


  • public final class FileAttributesUtils
    extends java.lang.Object
    Utility class of plugin generic attributes
    • 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 request
        locale - 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 request
        locale - 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 entry
        listFilesSource - the list of source files to upload
        locale - 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 entry
        request - the HTTP request