Interface IFileMapProviding<T extends IKeyDependentFileEntity<?,D>,D extends IFileDataEntity<T>>

All Superinterfaces:
Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>, de.xima.cmn.dao.interfaces.IEntity<Long>, ITransferable, ITransferableEntity, Serializable
All Known Implementing Classes:
Mandant, UserProfile

public interface IFileMapProviding<T extends IKeyDependentFileEntity<?,D>,D extends IFileDataEntity<T>> extends ITransferableEntity
Common interface for classes providing a file map
Since:
8.0.0
Author:
XIMA Media GmbH
  • Method Details

    • getFileMap

      Map<String,T> getFileMap()
    • setFileMap

      void setFileMap(Map<String,T> fileMap)
      DON'T USE! Hibernate is managing this collection, so if it is overridden, Hibernate can't keep track of it anymore. Use putFile(String, IKeyDependentFileEntity), removeFile(String) or getFileMap() instead to modify the map.
    • newFileEntiy

      T newFileEntiy()
      Creates a new instance of file entity which is connected to the base entity (this). However this entity is not yet persisted nor is it connected to file key
      Returns:
      a new file entity connected to this entity
    • setFileData

      default void setFileData(String fileKey, File file, Object userRef) throws FileNotFoundException, IOException
      Throws:
      FileNotFoundException
      IOException
    • setFileData

      default void setFileData(String fileKey, byte[] data, String fileName, Object userRef)
    • putFile

      default T putFile(String key, T file)
      Parameters:
      key - String to store file under
      file - the file to put into file map
      Returns:
      the file previously stored for the given key or null if there wasn't any
    • removeFile

      default T removeFile(String key)
      Removes the file mapping for the given key. See Map.remove(Object).
      Parameters:
      key - String key in the file map
      Returns:
      the removed file or null if there wasn't any