Class FileStoreServiceProvider
java.lang.Object
fr.paris.lutece.portal.service.file.implementation.FileStoreServiceProvider
- All Implemented Interfaces:
IFileStoreServiceProvider,Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFileStoreServiceProvider(String _name, IFileStoreService _fsService, IFileDownloadUrlService _dlService, IFileRBACService _rbacService, boolean _isDefault) -
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 FileService implementationsGet 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 namebooleanget 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 streamMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
healthCheck
-
Constructor Details
-
FileStoreServiceProvider
public FileStoreServiceProvider(String _name, IFileStoreService _fsService, IFileDownloadUrlService _dlService, IFileRBACService _rbacService, boolean _isDefault)
-
-
Method Details
-
getName
Description copied from interface:IFileStoreServiceProviderget the service name- Specified by:
getNamein interfaceIFileStoreServiceProvider- Returns:
- the service name
-
isDefault
public boolean isDefault()Description copied from interface:IFileStoreServiceProviderget the default- Specified by:
isDefaultin interfaceIFileStoreServiceProvider- Returns:
- true if default
-
storeFile
Description copied from interface:IFileStoreServiceProviderStores a file Lutece File- Specified by:
storeFilein interfaceIFileStoreServiceProvider- Parameters:
file- the file- Returns:
- The key of the stored file
- Throws:
FileServiceException
-
getFile
Description copied from interface:IFileStoreServiceProviderGet a file- Specified by:
getFilein interfaceIFileStoreServiceProvider- Parameters:
strKey- The key of the file- Returns:
- The file
- Throws:
FileServiceException
-
storeFileItem
public String storeFileItem(fr.paris.lutece.portal.service.upload.MultipartItem fileItem) throws FileServiceException Description copied from interface:IFileStoreServiceProviderStores a MultipartItem- Specified by:
storeFileItemin interfaceIFileStoreServiceProvider- Parameters:
fileItem- the fileItem- Returns:
- The key of the blob
- Throws:
FileServiceException
-
storeInputStream
Description copied from interface:IFileStoreServiceProviderStores an input stream- Specified by:
storeInputStreamin interfaceIFileStoreServiceProvider- Parameters:
inputStream- the input stream- Returns:
- The key of the blob
- Throws:
FileServiceException
-
storeBytes
Description copied from interface:IFileStoreServiceProviderStore a blob from a bytes array- Specified by:
storeBytesin interfaceIFileStoreServiceProvider- Parameters:
blob- The blob- Returns:
- The key of the blob
- Throws:
FileServiceException
-
getFileMetaData
Description copied from interface:IFileStoreServiceProviderGet a file object only filled with the meta data (name, size ...) without the physical file content- Specified by:
getFileMetaDatain interfaceIFileStoreServiceProvider- Parameters:
strKey- The key of the file- Returns:
- The file
- Throws:
FileServiceException
-
getInputStream
Description copied from interface:IFileStoreServiceProviderGets a blob asInputStream- Specified by:
getInputStreamin interfaceIFileStoreServiceProvider- Parameters:
strKey- the key- Returns:
- the
InputStream - Throws:
FileServiceException
-
delete
Description copied from interface:IFileStoreServiceProviderDelete a blob- Specified by:
deletein interfaceIFileStoreServiceProvider- Parameters:
strKey- The key of the blob- Throws:
FileServiceException
-
getFileFromRequestBO
public File getFileFromRequestBO(jakarta.servlet.http.HttpServletRequest request) throws AccessDeniedException, ExpiredLinkException, UserNotSignedException, FileServiceException Description copied from interface:IFileStoreServiceProviderget requested file from BO- Specified by:
getFileFromRequestBOin interfaceIFileStoreServiceProvider- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedExceptionFileServiceException
-
getFileFromRequestFO
public File getFileFromRequestFO(jakarta.servlet.http.HttpServletRequest request) throws AccessDeniedException, ExpiredLinkException, UserNotSignedException, FileServiceException Description copied from interface:IFileStoreServiceProviderget requested file from FO- Specified by:
getFileFromRequestFOin interfaceIFileStoreServiceProvider- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedExceptionFileServiceException
-
getFileDownloadUrlFO
Description copied from interface:IFileStoreServiceProviderGets the file download url for Front Office Lutece users- Specified by:
getFileDownloadUrlFOin interfaceIFileStoreServiceProvider- Parameters:
strKey- the- Returns:
- the download link
-
checkAccessRights
public void checkAccessRights(Map<String, String> fileData, fr.paris.lutece.api.user.User user) throws AccessDeniedException, UserNotSignedExceptionDescription copied from interface:IFileStoreServiceProvidercheck if current user can access the file- Specified by:
checkAccessRightsin interfaceIFileStoreServiceProvideruser- the current user- Throws:
AccessDeniedExceptionUserNotSignedException
-
getFileDownloadUrlFO
Description copied from interface:IFileStoreServiceProviderGets the file download url for Front Office Lutece users- Specified by:
getFileDownloadUrlFOin interfaceIFileStoreServiceProvider- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlBO
Description copied from interface:IFileStoreServiceProviderGets the file download url for Back Office admin Lutece users- Specified by:
getFileDownloadUrlBOin interfaceIFileStoreServiceProvider- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlBO
Description copied from interface:IFileStoreServiceProviderGets the file download url for Back Office admin Lutece users- Specified by:
getFileDownloadUrlBOin interfaceIFileStoreServiceProvider- Parameters:
strKey- the- Returns:
- the download link
-
checkLinkValidity
Description copied from interface:IFileStoreServiceProvidercheck if link is valid- Specified by:
checkLinkValidityin interfaceIFileStoreServiceProvider- Throws:
ExpiredLinkException
-
getDetail
get FileService implementations- Returns:
- a string
-