Class FileServiceImpl
java.lang.Object
org.exoplatform.commons.file.services.impl.FileServiceImpl
- All Implemented Interfaces:
FileService
File Service which stores the file metadata in a database, and uses a
BinaryProvider to store the file binary. Created by The eXo Platform SAS
Author : eXoPlatform exo@exoplatform.com
-
Constructor Summary
ConstructorsConstructorDescriptionFileServiceImpl(DataStorage dataStorage, BinaryProvider resourceProvider, NameSpaceService nameSpaceService, org.exoplatform.services.listener.ListenerService listenerService) -
Method Summary
Modifier and TypeMethodDescriptiondeleteFile(long id) Delete file with the given id The file is not physically deleted, it is only a logical deletiongetFile(long id) Get the file (info + binary) of the given idgetFileInfo(long id) Get only the file info of the given idgetFileInfoListByChecksum(String checksum) Get the files info of the given checksumgetFilesByChecksum(String checksum) Get the files (info + binary) of the given checksumupdateFile(FileItem file) Update the stored file using the provided DAO and binary provider.Store the file using the provided DAO and binary provider.
-
Constructor Details
-
FileServiceImpl
public FileServiceImpl(DataStorage dataStorage, BinaryProvider resourceProvider, NameSpaceService nameSpaceService, org.exoplatform.services.listener.ListenerService listenerService)
-
-
Method Details
-
getFileInfo
Description copied from interface:FileServiceGet only the file info of the given id- Specified by:
getFileInfoin interfaceFileService- Parameters:
id- file id- Returns:
- file info
-
getFileInfoListByChecksum
Description copied from interface:FileServiceGet the files info of the given checksum- Specified by:
getFileInfoListByChecksumin interfaceFileService- Parameters:
checksum- files checksum- Returns:
- list file info
-
getFile
Description copied from interface:FileServiceGet the file (info + binary) of the given id- Specified by:
getFilein interfaceFileService- Parameters:
id- file id- Returns:
- fileItem
- Throws:
FileStorageException- signals that an I/O exception of some sort has occurred.
-
writeFile
Description copied from interface:FileServiceStore the file using the provided DAO and binary provider. This method is transactional, meaning that if the write of the info or of the binary fails, nothing must be persisted.- Specified by:
writeFilein interfaceFileService- Parameters:
file- file item- Returns:
- updated file item
- Throws:
FileStorageException- signals that an error occur on save resource.IOException- signals that an I/O exception of some sort has occurred.
-
updateFile
Description copied from interface:FileServiceUpdate the stored file using the provided DAO and binary provider. This method is transactional, meaning that if the write of the info or of the binary fails, nothing must be persisted.- Specified by:
updateFilein interfaceFileService- Parameters:
file- file item- Returns:
- updated file item
- Throws:
FileStorageException- signals that an error occur on save resource.IOException- signals that an I/O exception of some sort has occurred.
-
deleteFile
Description copied from interface:FileServiceDelete file with the given id The file is not physically deleted, it is only a logical deletion- Specified by:
deleteFilein interfaceFileService- Parameters:
id- Id of the file to delete- Returns:
- file Info
-
getFilesByChecksum
Description copied from interface:FileServiceGet the files (info + binary) of the given checksum- Specified by:
getFilesByChecksumin interfaceFileService- Parameters:
checksum- files checksum- Returns:
- list fileItem
- Throws:
FileStorageException- signals that an I/O exception of some sort has occurred.
-