Package mops.businesslogic.directory
Interface DirectoryService
-
- All Known Implementing Classes:
DirectoryServiceImpl
@Service public interface DirectoryServiceHandles meta data for directories.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DirectorycreateFolder(Account account, long parentDirId, java.lang.String dirName)Creates a new folder inside a folder.voiddeleteDirectory(Directory directory)Internal use only: possible security flaw!.java.util.List<Directory>getAllRootDirectories()Fetches list of all root directories.longgetDirCountInGroup(long groupId)Get the total number of directories in a group.DirectorygetDirectory(long dirId)Internal use only: possible security flaw!.java.util.List<Directory>getDirectoryPath(long dirId)Builds directory path as list.GroupRootDirWrappergetOrCreateRootFolder(long groupId)Creates the group root directory.java.util.List<Directory>getSubFolders(Account account, long parentDirID)Returns all folders of the parent folder.longgetTotalDirCount()Get the total number of directories in all groups.DirectoryrenameDirectory(Account account, long dirId, java.lang.String newName)renames a directory.DirectorysaveDirectory(Directory directory)Internal use only: possible security flaw!.DirectoryPermissionsupdatePermission(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 MopsExceptionGet the total number of directories in a group.- Parameters:
groupId- group- Returns:
- directory count
- Throws:
MopsException
-
getTotalDirCount
long getTotalDirCount() throws MopsExceptionGet 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.
-
-