Interface FileService

  • All Known Implementing Classes:
    FileServiceImpl

    @Service
    public interface FileService
    Handles communication with the storage service.
    • Method Detail

      • saveFile

        void saveFile​(Account account,
                      long dirId,
                      org.springframework.web.multipart.MultipartFile multipartFile,
                      java.util.Set<java.lang.String> tags)
               throws MopsException
        Saves a file.
        Parameters:
        account - user credentials
        dirId - directory id of the future parent folder
        multipartFile - the binary code of the file
        tags - the file tag
        Throws:
        MopsException
      • deleteFile

        Directory deleteFile​(Account account,
                             long fileId)
                      throws MopsException
        Deletes a file.
        Parameters:
        account - user credentials
        fileId - file id of file to be deleted
        Returns:
        parent directory Id
        Throws:
        MopsException
      • getFileInfo

        FileInfo getFileInfo​(Account account,
                             long fileId)
                      throws MopsException
        Retrieves file meta data.
        Parameters:
        account - the account object.
        fileId - the file ID
        Returns:
        the meta info.
        Throws:
        MopsException - on error.
      • getFilesOfDirectory

        java.util.List<FileListEntry> getFilesOfDirectory​(Account account,
                                                          long dirId)
                                                   throws MopsException
        Retrieves file meta data of all files in a directory.
        Parameters:
        account - the account object.
        dirId - the file ID
        Returns:
        the meta info.
        Throws:
        MopsException - on error.
      • getAllFileIds

        java.util.Set<java.lang.Long> getAllFileIds()
                                             throws MopsException
        Fetches all IDs.
        Returns:
        all File IDs
        Throws:
        MopsException
      • deleteFileWithoutMeta

        void deleteFileWithoutMeta​(long fileId)
                            throws MopsException
        INTERNAL USE ONLY. Deletes a file without checking permission. And without removing the corresponding FileInfo.
        Parameters:
        fileId - the id of the file
        Throws:
        MopsException - on error
      • renameFile

        Directory renameFile​(Account account,
                             long fileId,
                             java.lang.String newName)
                      throws MopsException
        Renames a file.
        Parameters:
        account - user credentials
        fileId - the file ID
        newName - the new filename
        Returns:
        the directory of the dir
        Throws:
        MopsException - on error