Package mops.businesslogic.file
Interface FileInfoService
-
- All Known Implementing Classes:
FileInfoServiceImpl
@Service public interface FileInfoServiceHandles meta data for files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteFileInfo(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.FileInfofetchFileInfo(long fileId)Get a file by id.longgetFileCountInGroup(long groupId)Get the total number of files in a group.longgetStorageUsageInGroup(long groupId)Get the total number of bytes used by that group.longgetTotalFileCount()Get the total number of files in all groups.longgetTotalStorageUsage()Get the total number of bytes used by all groups.FileInfosaveFileInfo(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 MopsExceptionDelete file from database by id.- Parameters:
fileId- file id- Throws:
MopsException
-
fetchAllFileInfoIds
java.util.Set<java.lang.Long> fetchAllFileInfoIds() throws MopsExceptionFetches all available FileInfo ids.- Returns:
- all ids
- Throws:
MopsException- on error
-
fetchAllOrphanedFileInfos
java.util.Set<java.lang.Long> fetchAllOrphanedFileInfos() throws MopsExceptionFetches all FileInfos which are in non existing directories.- Returns:
- all ids
- Throws:
MopsException- on error
-
getStorageUsageInGroup
long getStorageUsageInGroup(long groupId) throws MopsExceptionGet the total number of bytes used by that group.- Parameters:
groupId- group- Returns:
- bytes used
- Throws:
MopsException
-
getTotalStorageUsage
long getTotalStorageUsage() throws MopsExceptionGet the total number of bytes used by all groups.- Returns:
- bytes used
- Throws:
MopsException
-
getFileCountInGroup
long getFileCountInGroup(long groupId) throws MopsExceptionGet the total number of files in a group.- Parameters:
groupId- group- Returns:
- file count
- Throws:
MopsException
-
getTotalFileCount
long getTotalFileCount() throws MopsExceptionGet the total number of files in all groups.- Returns:
- file count
- Throws:
MopsException
-
-