Interface IFileStoreServiceProvider
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
LocalDatabaseFileService
public interface IFileStoreServiceProvider extends Serializable
File Store Service Provider Interface. InputStream methods should be used for very large blobs
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckAccessRights(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(String strKey)Delete a blobFilegetFile(String strKey)Get a fileStringgetFileDownloadUrlBO(String strKey)Gets the file download url for Back Office admin Lutece usersStringgetFileDownloadUrlBO(String strKey, Map<String,String> additionnalData)Gets the file download url for Back Office admin Lutece usersStringgetFileDownloadUrlFO(String strKey)Gets the file download url for Front Office Lutece usersStringgetFileDownloadUrlFO(String strKey, Map<String,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(String strKey)Get a file object only filled with the meta data (name, size ...) without the physical file contentInputStreamgetInputStream(String strKey)Gets a blob asInputStreamStringgetName()get the service namebooleanisDefault()get the defaultStringstoreBytes(byte[] blob)Store a blob from a bytes arrayStringstoreFile(File file)Stores a file Lutece FileStringstoreFileItem(org.apache.commons.fileupload.FileItem fileItem)Stores a org.apache.commons.fileupload.FileItemStringstoreInputStream(InputStream inputStream)Stores an input stream
-
-
-
Method Detail
-
getName
String getName()
get the service name- Returns:
- the service name
-
isDefault
boolean isDefault()
get the default- Returns:
- true if default
-
storeFile
String storeFile(File file)
Stores a file Lutece File- Parameters:
file- the file- Returns:
- The key of the stored file
-
storeFileItem
String storeFileItem(org.apache.commons.fileupload.FileItem fileItem)
Stores a org.apache.commons.fileupload.FileItem- Parameters:
fileItem- the fileItem- Returns:
- The key of the blob
-
storeInputStream
String storeInputStream(InputStream inputStream)
Stores an input stream- Parameters:
inputStream- the input stream- Returns:
- The key of the blob
-
storeBytes
String storeBytes(byte[] blob)
Store a blob from a bytes array- Parameters:
blob- The blob- Returns:
- The key of the blob
-
getFile
File getFile(String strKey)
Get a file- Parameters:
strKey- The key of the file- Returns:
- The file
-
getFileMetaData
File getFileMetaData(String strKey)
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
-
getInputStream
InputStream getInputStream(String strKey)
Gets a blob asInputStream- Parameters:
strKey- the key- Returns:
- the
InputStream
-
delete
void delete(String strKey)
Delete a blob- Parameters:
strKey- The key of the blob
-
getFileDownloadUrlFO
String getFileDownloadUrlFO(String strKey)
Gets the file download url for Front Office Lutece users- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlFO
String getFileDownloadUrlFO(String strKey, Map<String,String> additionnalData)
Gets the file download url for Front Office Lutece users- Parameters:
strKey- theadditionnalData-- Returns:
- the download link
-
getFileDownloadUrlBO
String getFileDownloadUrlBO(String strKey)
Gets the file download url for Back Office admin Lutece users- Parameters:
strKey- the- Returns:
- the download link
-
getFileDownloadUrlBO
String getFileDownloadUrlBO(String strKey, Map<String,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
get requested file from BO- Parameters:
request-- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedException
-
getFileFromRequestFO
File getFileFromRequestFO(javax.servlet.http.HttpServletRequest request) throws AccessDeniedException, ExpiredLinkException, UserNotSignedException
get requested file from FO- Parameters:
request-- Returns:
- the file
- Throws:
AccessDeniedExceptionExpiredLinkExceptionUserNotSignedException
-
checkAccessRights
void checkAccessRights(Map<String,String> fileData, fr.paris.lutece.api.user.User user) throws AccessDeniedException, UserNotSignedException
check if current user can access the file- Parameters:
fileData-user- the current user- Throws:
AccessDeniedExceptionUserNotSignedException
-
checkLinkValidity
void checkLinkValidity(Map<String,String> fileData) throws ExpiredLinkException
check if link is valid- Parameters:
fileData-- Throws:
ExpiredLinkException
-
-