Interface IFileStoreServiceProvider
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
LocalDatabaseFileService
public interface IFileStoreServiceProvider extends java.io.SerializableFile Store Service Provider Interface. InputStream methods should be used for very large blobs
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcheckAccessRights(java.util.Map<java.lang.String,java.lang.String> fileData, fr.paris.lutece.api.user.User user)check if current user can access the filevoidcheckLinkValidity(java.util.Map<java.lang.String,java.lang.String> fileData)check if link is validvoiddelete(java.lang.String strKey)Delete a blobFilegetFile(java.lang.String strKey)Get a filejava.lang.StringgetFileDownloadUrlBO(java.lang.String strKey)Gets the file download url for Back Office admin Lutece usersjava.lang.StringgetFileDownloadUrlBO(java.lang.String strKey, java.util.Map<java.lang.String,java.lang.String> additionnalData)Gets the file download url for Back Office admin Lutece usersjava.lang.StringgetFileDownloadUrlFO(java.lang.String strKey)Gets the file download url for Front Office Lutece usersjava.lang.StringgetFileDownloadUrlFO(java.lang.String strKey, java.util.Map<java.lang.String,java.lang.String> additionnalData)Gets the file download url for Front Office Lutece usersFilegetFileFromRequestBO(javax.servlet.http.HttpServletRequest request)get requested file from BOFilegetFileFromRequestFO(javax.servlet.http.HttpServletRequest request)get requested file from FOFilegetFileMetaData(java.lang.String strKey)Get a file object only filled with the meta data (name, size ...) without the physical file contentjava.io.InputStreamgetInputStream(java.lang.String strKey)Gets a blob asInputStreamjava.lang.StringgetName()get the service namedefault booleanhealthCheck()health checkbooleanisDefault()get the defaultjava.lang.StringstoreBytes(byte[] blob)Store a blob from a bytes arrayjava.lang.StringstoreFile(File file)Stores a file Lutece Filejava.lang.StringstoreFileItem(org.apache.commons.fileupload.FileItem fileItem)Stores a org.apache.commons.fileupload.FileItemjava.lang.StringstoreInputStream(java.io.InputStream inputStream)Stores an input stream
-
-
-
Method Detail
-
getName
java.lang.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
java.lang.String storeFile(File file) throws FileServiceException
Stores a file Lutece File- Parameters:
file- the file- Returns:
- The key of the stored file
- Throws:
FileServiceException
-
storeFileItem
java.lang.String storeFileItem(org.apache.commons.fileupload.FileItem fileItem) throws FileServiceExceptionStores a org.apache.commons.fileupload.FileItem- Parameters:
fileItem- the fileItem- Returns:
- The key of the blob
- Throws:
FileServiceException
-
storeInputStream
java.lang.String storeInputStream(java.io.InputStream inputStream) throws FileServiceExceptionStores an input stream- Parameters:
inputStream- the input stream- Returns:
- The key of the blob
- Throws:
FileServiceException
-
storeBytes
java.lang.String storeBytes(byte[] blob) throws FileServiceExceptionStore a blob from a bytes array- Parameters:
blob- The blob- Returns:
- The key of the blob
- Throws:
FileServiceException
-
getFile
File getFile(java.lang.String strKey) throws FileServiceException
Get a file- Parameters:
strKey- The key of the file- Returns:
- The file
- Throws:
FileServiceException
-
getFileMetaData
File getFileMetaData(java.lang.String strKey) throws FileServiceException
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
java.io.InputStream getInputStream(java.lang.String strKey) throws FileServiceExceptionGets a blob asInputStream- Parameters:
strKey- the key- Returns:
- the
InputStream - Throws:
FileServiceException
-
delete
void delete(java.lang.String strKey) throws FileServiceExceptionDelete a blob- Parameters:
strKey- The key of the blob- Throws:
FileServiceException
-
getFileDownloadUrlFO
java.lang.String getFileDownloadUrlFO(java.lang.String strKey)
Gets the file download url for Front Office Lutece users- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlFO
java.lang.String getFileDownloadUrlFO(java.lang.String strKey, java.util.Map<java.lang.String,java.lang.String> additionnalData)Gets the file download url for Front Office Lutece users- Parameters:
strKey- theadditionnalData-- Returns:
- the download link
-
getFileDownloadUrlBO
java.lang.String getFileDownloadUrlBO(java.lang.String strKey)
Gets the file download url for Back Office admin Lutece users- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlBO
java.lang.String getFileDownloadUrlBO(java.lang.String strKey, java.util.Map<java.lang.String,java.lang.String> additionnalData)Gets the file download url for Back Office admin Lutece users- Parameters:
strKey- theadditionnalData-- Returns:
- the download link
-
getFileFromRequestBO
File getFileFromRequestBO(javax.servlet.http.HttpServletRequest request) throws AccessDeniedException, ExpiredLinkException, UserNotSignedException, FileServiceException
get requested file from BO- Parameters:
request-- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedExceptionFileServiceException
-
getFileFromRequestFO
File getFileFromRequestFO(javax.servlet.http.HttpServletRequest request) throws AccessDeniedException, ExpiredLinkException, UserNotSignedException, FileServiceException
get requested file from FO- Parameters:
request-- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedExceptionFileServiceException
-
checkAccessRights
void checkAccessRights(java.util.Map<java.lang.String,java.lang.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
void checkLinkValidity(java.util.Map<java.lang.String,java.lang.String> fileData) throws ExpiredLinkExceptioncheck if link is valid- Parameters:
fileData-- Throws:
ExpiredLinkException
-
-