Interface IFilePersistor

All Known Implementing Classes:
FileSystemPersistor, JPAFilePersistor

public interface IFilePersistor
Interface used to interact with a file container (database, file system, etc)

Author:
Jeromy Altuna
  • Method Details

    • save

      void save(AttachedFile file)
      Persist a File (stored somewhere).

      This method should generate a unique identifier for the file.

      Parameters:
      file - Object of class AttachedFile to be persisted
    • remove

      void remove(String id)
      Remove the file from the storage container.

      Parameters:
      id - unique identifier of the file
    • removeLibrary

      void removeLibrary(String libraryId)
      Removes files belonging to a library.

      Parameters:
      libraryId - Unique identifier of the files library
    • find

      AttachedFile find(String id)
      Find AttachedFile by primary key.

      Parameters:
      id - unique identifier of the file
      Returns:
      An instance of the file found or null if the file does not exist
    • findLibrary

      Collection<AttachedFile> findLibrary(String libraryId)
      Find files belonging to a library.

      Parameters:
      libraryId - Unique identifier of the files library
      Returns:
      Collection of objects of the class AttachedFile