Interface FileService

All Known Implementing Classes:
FileServiceImpl

public interface FileService
Created by The eXo Platform SAS Author : eXoPlatform exo@exoplatform.com
  • Method Details

    • getFileInfo

      FileInfo getFileInfo(long id)
      Get only the file info of the given id
      Parameters:
      id - file id
      Returns:
      file info
    • getFile

      FileItem getFile(long id) throws FileStorageException
      Get the file (info + binary) of the given id
      Parameters:
      id - file id
      Returns:
      fileItem
      Throws:
      FileStorageException - signals that an I/O exception of some sort has occurred.
    • writeFile

      Store the file using the provided DAO and binary provider. This method is transactional, meaning that if the write of the info or of the binary fails, nothing must be persisted.
      Parameters:
      file - file item
      Returns:
      updated file item
      Throws:
      IOException - signals that an I/O exception of some sort has occurred.
      FileStorageException - signals that an error occur on save resource.
    • updateFile

      Update the stored file using the provided DAO and binary provider. This method is transactional, meaning that if the write of the info or of the binary fails, nothing must be persisted.
      Parameters:
      file - file item
      Returns:
      updated file item
      Throws:
      IOException - signals that an I/O exception of some sort has occurred.
      FileStorageException - signals that an error occur on save resource.
    • deleteFile

      FileInfo deleteFile(long id)
      Delete file with the given id The file is not physically deleted, it is only a logical deletion
      Parameters:
      id - Id of the file to delete
      Returns:
      file Info
    • getFileInfoListByChecksum

      default List<FileInfo> getFileInfoListByChecksum(String checksum) throws Exception
      Get the files info of the given checksum
      Parameters:
      checksum - files checksum
      Returns:
      list file info
      Throws:
      Exception
    • getFilesByChecksum

      default List<FileItem> getFilesByChecksum(String checksum) throws FileStorageException
      Get the files (info + binary) of the given checksum
      Parameters:
      checksum - files checksum
      Returns:
      list fileItem
      Throws:
      FileStorageException - signals that an I/O exception of some sort has occurred.