Class UserPortalFileUtils

java.lang.Object
de.xima.fc.user_portal.common.UserPortalFileUtils

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

    • UserPortalFileUtils

      public UserPortalFileUtils()
  • Method Details

    • 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.
    • getUniqueFileName

      public static String getUniqueFileName(String fileName, List<String> fileNames)
    • getDownloadLink

      public static String getDownloadLink(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(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<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.