Class UserPortalFileUtils
java.lang.Object
de.xima.fc.user_portal.common.UserPortalFileUtils
- Since:
- 8.4.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<UserPortalFileModel> createFiles(List<BaseFormRecordAttachmentResource> attachments) Creates a list of user portal file models from a list of attachment resources.static org.primefaces.model.StreamedContentGet an empty streamed content.static StringgetDownloadLink(BaseUserPortalFileResource resource) Gets the download link for a file resource.static StringgetDownloadLink(BaseUserProfileFileResource resource) Gets the download link for a file resource.static byte[]getFileData(Path file) Get the binary data of a file on the file system as a byte array.static org.primefaces.model.StreamedContentstatic StringgetUniqueFileName(String fileName, List<String> fileNames)
-
Constructor Details
-
UserPortalFileUtils
public UserPortalFileUtils()
-
-
Method Details
-
getFileData
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
-
getDownloadLink
Gets the download link for a file resource. This just returns thedownloadentries from the resourceslinkssection.- Parameters:
resource- A file resource.- Returns:
- The download link for the file resource.
-
getDownloadLink
Gets the download link for a file resource. This just returns thedownloadentries from the resourceslinkssection.- Parameters:
resource- A file resource.- Returns:
- The download link for the file resource.
-
getStreamedContentFromFile
-
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.
-