Package mops.businesslogic.directory
Interface DirectoryService
-
- All Known Implementing Classes:
DirectoryServiceImpl
@Service public interface DirectoryService
Handles meta data for directories.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Directory
createFolder(Account account, long parentDirId, java.lang.String dirName)
Creates a new folder inside a folder.void
deleteDirectory(Directory directory)
Internal use only: possible security flaw!.java.util.List<Directory>
getAllRootDirectories()
Fetches list of all root directories.long
getDirCountInGroup(long groupId)
Get the total number of directories in a group.Directory
getDirectory(long dirId)
Internal use only: possible security flaw!.java.util.List<Directory>
getDirectoryPath(long dirId)
Builds directory path as list.GroupRootDirWrapper
getOrCreateRootFolder(long groupId)
Creates the group root directory.java.util.List<Directory>
getSubFolders(Account account, long parentDirID)
Returns all folders of the parent folder.long
getTotalDirCount()
Get the total number of directories in all groups.Directory
renameDirectory(Account account, long dirId, java.lang.String newName)
renames a directory.Directory
saveDirectory(Directory directory)
Internal use only: possible security flaw!.DirectoryPermissions
updatePermission(Account account, long dirId, DirectoryPermissions permissions)
Replaces the permissions for a directory and all its parents and children (which use the same permissions object) with the given ones.
-
-
-
Method Detail
-
getSubFolders
java.util.List<Directory> getSubFolders(Account account, long parentDirID) throws MopsException
Returns all folders of the parent folder.- Parameters:
account
- user credentialsparentDirID
- 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 credentialsparentDirId
- id of the parent folderdirName
- 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 credentialsdirId
- directory id for which the permission should be changedpermissions
- 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 credentialsdirId
- directory IDnewName
- 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.
-
-