Interface DirectoryService

  • All Known Implementing Classes:
    DirectoryServiceImpl

    @Service
    public interface DirectoryService
    Handles meta data for directories.
    • Method Detail

      • getSubFolders

        java.util.List<Directory> getSubFolders​(Account account,
                                                long parentDirID)
                                         throws MopsException
        Returns all folders of the parent folder.
        Parameters:
        account - user credentials
        parentDirID - id of the parent folder
        Returns:
        list of folders
        Throws:
        MopsException
      • getDirectoryPath

        java.util.List<Directory> getDirectoryPath​(long dirId)
                                            throws MopsException
        Builds directory path as list.
        Parameters:
        dirId - highest dir of path
        Returns:
        directory path ordered list
        Throws:
        MopsException
      • getOrCreateRootFolder

        GroupRootDirWrapper getOrCreateRootFolder​(long groupId)
                                           throws MopsException
        Creates the group root directory.
        Parameters:
        groupId - the group id
        Returns:
        the directory created
        Throws:
        MopsException
      • createFolder

        Directory createFolder​(Account account,
                               long parentDirId,
                               java.lang.String dirName)
                        throws MopsException
        Creates a new folder inside a folder.
        Parameters:
        account - user credentials
        parentDirId - id of the parent folder
        dirName - name of the new folder
        Returns:
        id of the new folder
        Throws:
        MopsException
      • updatePermission

        DirectoryPermissions updatePermission​(Account account,
                                              long dirId,
                                              DirectoryPermissions permissions)
                                       throws MopsException
        Replaces the permissions for a directory and all its parents and children (which use the same permissions object) with the given ones.
        Parameters:
        account - user credentials
        dirId - directory id for which the permission should be changed
        permissions - new permissions
        Returns:
        the updated directory permissions
        Throws:
        MopsException
      • getDirectory

        Directory getDirectory​(long dirId)
                        throws MopsException
        Internal use only: possible security flaw!. Check permission before fetching!
        Parameters:
        dirId - the id of the parent folder
        Returns:
        directory object of the requested folder
        Throws:
        MopsException - on error
      • saveDirectory

        Directory saveDirectory​(Directory directory)
                         throws MopsException
        Internal use only: possible security flaw!. Check permission before saving!
        Parameters:
        directory - directory to be saved
        Returns:
        directory object of the requested folder
        Throws:
        MopsException - on error
      • deleteDirectory

        void deleteDirectory​(Directory directory)
                      throws MopsException
        Internal use only: possible security flaw!. Check permission before deleting!
        Parameters:
        directory - directory to be deleted
        Throws:
        MopsException - on error
      • getDirCountInGroup

        long getDirCountInGroup​(long groupId)
                         throws MopsException
        Get the total number of directories in a group.
        Parameters:
        groupId - group
        Returns:
        directory count
        Throws:
        MopsException
      • getTotalDirCount

        long getTotalDirCount()
                       throws MopsException
        Get the total number of directories in all groups.
        Returns:
        directory count
        Throws:
        MopsException
      • renameDirectory

        Directory renameDirectory​(Account account,
                                  long dirId,
                                  java.lang.String newName)
                           throws MopsException
        renames a directory.
        Parameters:
        account - user credentials
        dirId - directory ID
        newName - new name
        Returns:
        the directory
        Throws:
        MopsException - on error
      • getAllRootDirectories

        java.util.List<Directory> getAllRootDirectories()
                                                 throws MopsException
        Fetches list of all root directories.
        Returns:
        all root directories.
        Throws:
        MopsException - on error.