Interface IFileStoreServiceProvider
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
FileStoreServiceProvider
File Store Service Provider Interface. InputStream methods should be used for very large blobs
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAccessRights(Map<String, String> fileData, fr.paris.lutece.api.user.User user) check if current user can access the filevoidcheckLinkValidity(Map<String, String> fileData) check if link is validvoidDelete a blobGet a filegetFileDownloadUrlBO(String strKey) Gets the file download url for Back Office admin Lutece usersgetFileDownloadUrlBO(String strKey, Map<String, String> additionnalData) Gets the file download url for Back Office admin Lutece usersgetFileDownloadUrlFO(String strKey) Gets the file download url for Front Office Lutece usersgetFileDownloadUrlFO(String strKey, Map<String, String> additionnalData) Gets the file download url for Front Office Lutece usersgetFileFromRequestBO(jakarta.servlet.http.HttpServletRequest request) get requested file from BOgetFileFromRequestFO(jakarta.servlet.http.HttpServletRequest request) get requested file from FOgetFileMetaData(String strKey) Get a file object only filled with the meta data (name, size ...) without the physical file contentgetInputStream(String strKey) Gets a blob asInputStreamgetName()get the service namedefault booleanhealth checkbooleanget the defaultstoreBytes(byte[] blob) Store a blob from a bytes arrayStores a file Lutece FilestoreFileItem(fr.paris.lutece.portal.service.upload.MultipartItem fileItem) Stores a MultipartItemstoreInputStream(InputStream inputStream) Stores an input stream
-
Method Details
-
getName
String getName()get the service name- Returns:
- the service name
-
isDefault
boolean isDefault()get the default- Returns:
- true if default
-
healthCheck
default boolean healthCheck()health check- Returns:
- true if available
-
storeFile
Stores a file Lutece File- Parameters:
file- the file- Returns:
- The key of the stored file
- Throws:
FileServiceException
-
storeFileItem
String storeFileItem(fr.paris.lutece.portal.service.upload.MultipartItem fileItem) throws FileServiceException Stores a MultipartItem- Parameters:
fileItem- the fileItem- Returns:
- The key of the blob
- Throws:
FileServiceException
-
storeInputStream
Stores an input stream- Parameters:
inputStream- the input stream- Returns:
- The key of the blob
- Throws:
FileServiceException
-
storeBytes
Store a blob from a bytes array- Parameters:
blob- The blob- Returns:
- The key of the blob
- Throws:
FileServiceException
-
getFile
Get a file- Parameters:
strKey- The key of the file- Returns:
- The file
- Throws:
FileServiceException
-
getFileMetaData
Get a file object only filled with the meta data (name, size ...) without the physical file content- Parameters:
strKey- The key of the file- Returns:
- The file
- Throws:
FileServiceException
-
getInputStream
Gets a blob asInputStream- Parameters:
strKey- the key- Returns:
- the
InputStream - Throws:
FileServiceException
-
delete
Delete a blob- Parameters:
strKey- The key of the blob- Throws:
FileServiceException
-
getFileDownloadUrlFO
Gets the file download url for Front Office Lutece users- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlFO
Gets the file download url for Front Office Lutece users- Parameters:
strKey- theadditionnalData-- Returns:
- the download link
-
getFileDownloadUrlBO
Gets the file download url for Back Office admin Lutece users- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlBO
Gets the file download url for Back Office admin Lutece users- Parameters:
strKey- theadditionnalData-- Returns:
- the download link
-
getFileFromRequestBO
File getFileFromRequestBO(jakarta.servlet.http.HttpServletRequest request) throws AccessDeniedException, ExpiredLinkException, UserNotSignedException, FileServiceException get requested file from BO- Parameters:
request-- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedExceptionFileServiceException
-
getFileFromRequestFO
File getFileFromRequestFO(jakarta.servlet.http.HttpServletRequest request) throws AccessDeniedException, ExpiredLinkException, UserNotSignedException, FileServiceException get requested file from FO- Parameters:
request-- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedExceptionFileServiceException
-
checkAccessRights
void checkAccessRights(Map<String, String> fileData, fr.paris.lutece.api.user.User user) throws AccessDeniedException, UserNotSignedExceptioncheck if current user can access the file- Parameters:
fileData-user- the current user- Throws:
AccessDeniedExceptionUserNotSignedException
-
checkLinkValidity
check if link is valid- Parameters:
fileData-- Throws:
ExpiredLinkException
-