Class UserPortalFileUtils


  • public class UserPortalFileUtils
    extends Object
    Since:
    8.4.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • UserPortalFileUtils

        public UserPortalFileUtils()
    • Method Detail

      • getFileData

        public static byte[] getFileData​(Path file)
        Get the binary data of a file on the file system as a byte array.
        Parameters:
        file - The file for which to get the binary data.
        Returns:
        The binary data of the file as a byte array.
      • emptyStreamedContent

        public static org.primefaces.model.StreamedContent emptyStreamedContent()
        Get an empty streamed content.
        Returns:
        The empty streamed content.
      • getDownloadLink

        public static String getDownloadLink​(de.xima.fc.api.rest.pub.client.user_portal.model.BaseUserPortalFileResource resource)
        Gets the download link for a file resource. This just returns the download entries from the resources links section.
        Parameters:
        resource - A file resource.
        Returns:
        The download link for the file resource.
      • getDownloadLink

        public static String getDownloadLink​(de.xima.fc.api.rest.pub.client.user.model.BaseUserProfileFileResource resource)
        Gets the download link for a file resource. This just returns the download entries from the resources links section.
        Parameters:
        resource - A file resource.
        Returns:
        The download link for the file resource.
      • getStreamedContentFromFile

        public static org.primefaces.model.StreamedContent getStreamedContentFromFile​(File file)
      • createFiles

        public static List<UserPortalFileModel> createFiles​(List<de.xima.fc.api.rest.pub.client.form_record.model.BaseFormRecordAttachmentResource> attachments)
        Creates a list of user portal file models from a list of attachment resources.
        Parameters:
        attachments - The list of attachment resources.
        Returns:
        A list of user portal file models.