Interface IFileDataPersistenceAdapter<PersistenceContext,Entity>
-
- Type Parameters:
PersistenceContext- Type of the persistence context used for accessing the persistence layer.Entity- Type of the entity containing the file data.
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
IEntityFileSystemPersistenceAdapter<PersistenceContext,Entity,Scope>
- All Known Implementing Classes:
FileEntityPersistenceAdapter,FileEntityViewPersistenceAdapter,FileProvidingEntityAdapter,FormThemeFileViewPersistenceAdapter
public interface IFileDataPersistenceAdapter<PersistenceContext,Entity> extends Serializable
A persistence adapter for entities that allows access to a binary file. Allows read and write access to the file data. All changes must be synchronized immediately with persistence layer.Usually, a file is represented by a subtype of
IFileEntity. Some entities have an additional wrapper, such asIFileProvidingwith a 1:1 relationship to aIFileEntity.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStreamopenForRead(Supplier<PersistenceContext> persistenceContextFactory, Entity entity)Opens an input stream to the content of a file entity.OutputStreamopenForWrite(Supplier<PersistenceContext> persistenceContextFactory, Entity entity)Opens an output stream for changing the content of a file entity.
-
-
-
Method Detail
-
openForRead
InputStream openForRead(Supplier<PersistenceContext> persistenceContextFactory, Entity entity) throws IOException
Opens an input stream to the content of a file entity.- Parameters:
persistenceContextFactory- Persistence context factory to use for accessing the persistence layer.entity- The entity to open.- Returns:
- An input stream to the file content.
- Throws:
IOException- If an error occurs while opening the file.
-
openForWrite
OutputStream openForWrite(Supplier<PersistenceContext> persistenceContextFactory, Entity entity) throws IOException
Opens an output stream for changing the content of a file entity. This should also update the file metadata, such as the user who last modified the file and the last modified time.- Parameters:
persistenceContextFactory- Persistence context factory to use for accessing the persistence layer.entity- The entity to open.- Returns:
- An output stream to the file content.
- Throws:
IOException- If an error occurs while opening the file.
-
-