Interface FileService<F extends AbstractFile<F,ID,S>,ID extends Serializable,S extends AbstractStorageInfo<F,ID,S>>

Type Parameters:
F - File to be handled
ID - Data type of the file id
S - Storage info of the file
All Known Implementing Classes:
AbstractFileService, DefaultIdentityFileService, DefaultSequenceFileService, DefaultUUIDFileService

@Service public interface FileService<F extends AbstractFile<F,ID,S>,ID extends Serializable,S extends AbstractStorageInfo<F,ID,S>>
Service able of permanently writing files and read them again later.
  • Method Details

    • storeFile

      F storeFile(String name, String mimeType, byte[] fileContent) throws IOException
      Stores a file in the configured storages.
      Parameters:
      name - Name of the file
      mimeType - Mime type of the file
      fileContent - Content of the file as byte array
      Returns:
      Storage info of the file
      Throws:
      IOException - If the file could not be stored
    • loadFile

      Optional<F> loadFile(ID fileId)
    • getAll

      @NotNull @NotNull List<F> getAll()
    • getAllFiltered

      @NotNull @NotNull List<F> getAllFiltered(org.springframework.data.jpa.domain.Specification<F> specification)
    • loadFromProviders

      @NotNull F loadFromProviders(@NotNull F f)
    • deleteFile

      boolean deleteFile(ID fileId)
    • markAsUnavailable

      void markAsUnavailable(S info)