Package mops.businesslogic.file
Interface FileInfoService
-
- All Known Implementing Classes:
FileInfoServiceImpl
@Service public interface FileInfoService
Handles meta data for files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteFileInfo(long fileId)
Delete file from database by id.java.util.Set<java.lang.Long>
fetchAllFileInfoIds()
Fetches all available FileInfo ids.java.util.List<FileInfo>
fetchAllFilesInDirectory(long dirId)
Lists all files in a specific directory.java.util.Set<java.lang.Long>
fetchAllOrphanedFileInfos()
Fetches all FileInfos which are in non existing directories.FileInfo
fetchFileInfo(long fileId)
Get a file by id.long
getFileCountInGroup(long groupId)
Get the total number of files in a group.long
getStorageUsageInGroup(long groupId)
Get the total number of bytes used by that group.long
getTotalFileCount()
Get the total number of files in all groups.long
getTotalStorageUsage()
Get the total number of bytes used by all groups.FileInfo
saveFileInfo(FileInfo fileInfo)
Save file to database.
-
-
-
Method Detail
-
fetchAllFilesInDirectory
java.util.List<FileInfo> fetchAllFilesInDirectory(long dirId) throws MopsException
Lists all files in a specific directory.- Parameters:
dirId
- directory id- Returns:
- a list of files in that directory
- Throws:
MopsException
-
fetchFileInfo
FileInfo fetchFileInfo(long fileId) throws MopsException
Get a file by id.- Parameters:
fileId
- file id- Returns:
- a FileInfo object
- Throws:
MopsException
-
saveFileInfo
FileInfo saveFileInfo(FileInfo fileInfo) throws MopsException
Save file to database.- Parameters:
fileInfo
- Metadata of a file- Returns:
- the freshly saved FileInfo
- Throws:
MopsException
-
deleteFileInfo
void deleteFileInfo(long fileId) throws MopsException
Delete file from database by id.- Parameters:
fileId
- file id- Throws:
MopsException
-
fetchAllFileInfoIds
java.util.Set<java.lang.Long> fetchAllFileInfoIds() throws MopsException
Fetches all available FileInfo ids.- Returns:
- all ids
- Throws:
MopsException
- on error
-
fetchAllOrphanedFileInfos
java.util.Set<java.lang.Long> fetchAllOrphanedFileInfos() throws MopsException
Fetches all FileInfos which are in non existing directories.- Returns:
- all ids
- Throws:
MopsException
- on error
-
getStorageUsageInGroup
long getStorageUsageInGroup(long groupId) throws MopsException
Get the total number of bytes used by that group.- Parameters:
groupId
- group- Returns:
- bytes used
- Throws:
MopsException
-
getTotalStorageUsage
long getTotalStorageUsage() throws MopsException
Get the total number of bytes used by all groups.- Returns:
- bytes used
- Throws:
MopsException
-
getFileCountInGroup
long getFileCountInGroup(long groupId) throws MopsException
Get the total number of files in a group.- Parameters:
groupId
- group- Returns:
- file count
- Throws:
MopsException
-
getTotalFileCount
long getTotalFileCount() throws MopsException
Get the total number of files in all groups.- Returns:
- file count
- Throws:
MopsException
-
-