Package de.xima.fc.entities.interfaces
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
-
Field Summary
Fields inherited from interface de.xima.cmn.dao.interfaces.IEntity
ATTR_ID
Fields inherited from interface de.xima.fc.entities.interfaces.ITransferableEntity
IMPORT_ID, INVALID_ID
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of file entity which is connected to the base entity (this
).default T
default T
removeFile
(String key) Removes the file mapping for the given key.default void
setFileData
(String fileKey, byte[] data, String fileName, Object userRef) default void
setFileData
(String fileKey, File file, Object userRef) void
setFileMap
(Map<String, T> fileMap) DON'T USE!Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface de.xima.cmn.dao.interfaces.IEntity
getId, isPersisted, setId
-
Method Details
-
getFileMap
-
setFileMap
DON'T USE! Hibernate is managing this collection, so if it is overridden, Hibernate can't keep track of it anymore. UseputFile(String, IKeyDependentFileEntity)
,removeFile(String)
orgetFileMap()
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
-
putFile
- Parameters:
key
-String
to store file underfile
- the file to put into file map- Returns:
- the file previously stored for the given key or
null
if there wasn't any
-
removeFile
Removes the file mapping for the given key. SeeMap.remove(Object)
.- Parameters:
key
-String
key in the file map- Returns:
- the removed file or
null
if there wasn't any
-