Class FileAPI


  • public class FileAPI
    extends ASubAPI
    API class for interaction with files.
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • FileAPI

        public FileAPI()
    • Method Detail

      • getFileStream

        public <D extends IFileDataEntity<F>,​F extends IKeyDependentFileEntity<E,​D>,​E extends IFileMapProviding<F,​D>> InputStream getFileStream​(UserContext uc,
                                                                                                                                                                        E entity,
                                                                                                                                                                        String fileKey)
        Returns the file data of a file belonging to the given entity with the given file key. If the file is not cache-able or not yet cached it will be read from the database otherwise it will be retrieved from the file cache.
        Type Parameters:
        E - file map providing base entity type
        D - file data entity type
        F - file entity type
        Parameters:
        uc - user context for database transactions.
        entity - that owns the file
        fileKey - key identifying the the file entity
        Returns:
        file data of the request file as an input stream.
        Since:
        8.0.0
      • getFileStreamFromFileEntity

        public <F extends IFileEntity<?,​?>> InputStream getFileStreamFromFileEntity​(UserContext uc,
                                                                                          F fileEntity)
        Returns the file data of the given file entity. If the file is not cache-able or not yet cached it will be read from the database otherwise it will be retrieved from the file cache.
        Type Parameters:
        F - file entity type
        Parameters:
        uc - user context for database transactions.
        fileEntity - that holds the file data
        Returns:
        file data of the request file as an input stream.
        Since:
        8.0.0
      • getFileData

        public <D extends IFileDataEntity<F>,​F extends IKeyDependentFileEntity<E,​D>,​E extends IFileMapProviding<F,​D>> byte[] getFileData​(UserContext uc,
                                                                                                                                                                 E entity,
                                                                                                                                                                 String fileKey)
        Returns the file data of a file belonging to the given entity with the given file key. If the file is not cache-able or not yet cached it will be read from the database otherwise it will be retrieved from the file cache.
        Type Parameters:
        E - file map providing base entity type
        D - file data entity type
        F - file entity type
        Parameters:
        uc - user context for database transactions.
        entity - that owns the file
        fileKey - key identifying the the file entity
        Returns:
        file data of the request file as a byte array.
        Since:
        8.0.0
      • getFileDataFromFileEntity

        public <F extends IFileEntity<?,​?>> byte[] getFileDataFromFileEntity​(UserContext uc,
                                                                                   F fileEntity)
        Returns the file data of the given file entity. If the file is not cache-able or not yet cached it will be read from the database otherwise it will be retrieved from the file cache.
        Type Parameters:
        F - file entity type
        Parameters:
        uc - user context for database transactions.
        fileEntity - that holds the file data
        Returns:
        file data of the request file as a byte array.
        Since:
        8.0.0
      • getUncachedFileData

        public <D extends IFileDataEntity<F>,​F extends IKeyDependentFileEntity<E,​D>,​E extends IFileMapProviding<F,​D>> byte[] getUncachedFileData​(UserContext uc,
                                                                                                                                                                         E entity,
                                                                                                                                                                         String fileKey)
        Returns the file data of a file belonging to the given entity with the given file key.
        Type Parameters:
        E - file map providing base entity type
        D - file data entity type
        F - file entity type
        Parameters:
        uc - user context for database transactions.
        entity - that owns the file
        fileKey - key identifying the the file entity
        Returns:
        file data of the request file as a byte array.
        Since:
        8.0.0
      • getUncachedFileEntityData

        public <T extends IFileEntity<?,​?>> byte[] getUncachedFileEntityData​(UserContext uc,
                                                                                   T fileEntity)