Package org.openxava.web.editors
Class JPAFilePersistor
- java.lang.Object
-
- org.openxava.web.editors.JPAFilePersistor
-
- All Implemented Interfaces:
IFilePersistor
public class JPAFilePersistor extends java.lang.Object implements IFilePersistor
An implementation ofIFilePersistor
- Author:
- Jeromy Altuna
-
-
Constructor Summary
Constructors Constructor Description JPAFilePersistor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttachedFile
find(java.lang.String id)
Find AttachedFile by primary key.java.util.Collection<AttachedFile>
findLibrary(java.lang.String libraryId)
Find files belonging to a library.void
remove(java.lang.String id)
Remove the file from the storage container.void
removeLibrary(java.lang.String libraryId)
Removes files belonging to a library.void
save(AttachedFile file)
Persist a File (stored somewhere).
-
-
-
Method Detail
-
save
public void save(AttachedFile file)
Description copied from interface:IFilePersistor
Persist a File (stored somewhere).This method should generate a unique identifier for the file.
- Specified by:
save
in interfaceIFilePersistor
- Parameters:
file
- Object of classAttachedFile
to be persisted- See Also:
IFilePersistor.save(AttachedFile)
-
remove
public void remove(java.lang.String id)
Description copied from interface:IFilePersistor
Remove the file from the storage container.- Specified by:
remove
in interfaceIFilePersistor
- Parameters:
id
- unique identifier of the file- See Also:
IFilePersistor.remove(String)
-
removeLibrary
public void removeLibrary(java.lang.String libraryId)
Description copied from interface:IFilePersistor
Removes files belonging to a library.- Specified by:
removeLibrary
in interfaceIFilePersistor
- Parameters:
libraryId
- Unique identifier of the files library- See Also:
IFilePersistor.removeLibrary(String)
-
findLibrary
public java.util.Collection<AttachedFile> findLibrary(java.lang.String libraryId)
Description copied from interface:IFilePersistor
Find files belonging to a library.- Specified by:
findLibrary
in interfaceIFilePersistor
- Parameters:
libraryId
- Unique identifier of the files library- Returns:
- Collection of objects of the class
AttachedFile
- See Also:
IFilePersistor.findLibrary(String)
-
find
public AttachedFile find(java.lang.String id)
Description copied from interface:IFilePersistor
Find AttachedFile by primary key.- Specified by:
find
in interfaceIFilePersistor
- Parameters:
id
- unique identifier of the file- Returns:
- An instance of the file found or null if the file does not exist
- See Also:
IFilePersistor.find(String)
-
-