Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-71627

The logic of DLValidatorImpl#validateFileSize is duplicated multiple times

    Details

      Description

      This logic is inside DLValidatorImpl.

      long maxSize = PrefsPropsUtil.getLong(PropsKeys.DL_FILE_MAX_SIZE);
      
      if ((maxSize > 0) && (size > maxSize)) {
      	throw new FileSizeException(fileName);
      }
      

      But it is also seen in these three files:

      modules/apps/collaboration/document-library/document-library-web/src/main/java/com/liferay/document/library/web/internal/upload/FileEntryDLUploadHandler.java
      modules/apps/social-private-messaging/social-private-messaging-web/src/main/java/com/liferay/social/privatemessaging/web/internal/portlet/PrivateMessagingPortlet.java
      modules/apps/web-experience/journal/journal-web/src/main/java/com/liferay/journal/web/internal/upload/ImageJournalUploadHandler.java
      

      We can just replace their logic with a call to DLValidator.

        Attachments

          Activity

            People

            Assignee:
            sylvia.luan Sylvia Luan
            Reporter:
            drew.brokke Drew Brokke
            Participants of an Issue:
            Recent user:
            Csaba Turcsan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 32 weeks, 3 days ago

                Packages

                Version Package
                7.0.0 DXP FP23
                7.0.4 CE GA5
                7.1.X
                Master