Interface IFileListHandler<File>

  • Type Parameters:
    File - The type representing a file in the underlying storage system.
    All Superinterfaces:
    Serializable

    public interface IFileListHandler<File>
    extends Serializable
    Interface for handling files within the <xi:fileList handler=#{...}/> component. The handler is responsible for storing uploaded files, and retrieving them when the user wishes to download them.
    Since:
    8.5.0
    • Method Detail

      • extractFileName

        String extractFileName​(File file)
        Extracts the file name from a given file object.
        Parameters:
        file - The file object.
        Returns:
        The name of the file.
      • extractFileSize

        long extractFileSize​(File file)
        Extracts the file size from a given file object, in bytes.
        Parameters:
        file - The file object.
        Returns:
        The size of the file in bytes.
      • extractMimeType

        String extractMimeType​(File file)
        Extracts the MIME type from a given file object.
        Parameters:
        file - The file object.
        Returns:
        The MIME type of the file.
      • openFile

        InputStream openFile​(File file)
                      throws IOException
        Opens an input stream to read the contents of a given file.
        Parameters:
        file - The file object.
        Returns:
        An InputStream to read the file's contents.
        Throws:
        IOException - If an I/O error occurs while opening the stream.
      • processFileUpload

        File processFileUpload​(IFileListUpload upload)
                        throws IOException
        Processes an uploaded file and stores it in the underlying storage system.
        Parameters:
        upload - The uploaded file information.
        Returns:
        The stored file object.
        Throws:
        IOException - If an I/O error occurs during file processing.