Class S3StorageFileService
- java.lang.Object
-
- fr.paris.lutece.plugins.sthree.service.file.implementation.S3StorageFileService
-
- All Implemented Interfaces:
fr.paris.lutece.portal.service.file.IFileStoreServiceProvider,Serializable
public class S3StorageFileService extends Object implements fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
S3StorageFileService.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description S3StorageFileService(fr.paris.lutece.portal.service.file.IFileDownloadUrlService _fileDownloadUrlService, fr.paris.lutece.portal.service.file.IFileRBACService _fileRBACService, String s3Url, String s3Bucket, String s3Key, String s3Password, String s3DefaultFilePath, String s3ForcePathStyle, String s3Region, String s3ChecksumAlgorithm, String s3ProxyHost, String s3ProxyUsername, String s3ProxyPassword, String s3RequestTimeout, String s3ConnectionTimeout)init
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAccessRights(Map<String,String> fileData, fr.paris.lutece.api.user.User user)voidcheckLinkValidity(Map<String,String> fileData)voiddelete(String strPath)fr.paris.lutece.portal.service.file.IFileDownloadUrlServicegetDownloadUrlService()Get the downloadServicefr.paris.lutece.portal.business.file.FilegetFile(String strPath)fr.paris.lutece.portal.business.file.FilegetFile(String strPath, boolean withPhysicalFile)get file from databaseStringgetFileDownloadUrlBO(String strKey)StringgetFileDownloadUrlBO(String strKey, Map<String,String> additionnalData)StringgetFileDownloadUrlFO(String strKey)StringgetFileDownloadUrlFO(String strKey, Map<String,String> additionnalData)fr.paris.lutece.portal.business.file.FilegetFileFromRequestBO(javax.servlet.http.HttpServletRequest request)fr.paris.lutece.portal.business.file.FilegetFileFromRequestFO(javax.servlet.http.HttpServletRequest request)fr.paris.lutece.portal.business.file.FilegetFileMetaData(String strPath)fr.paris.lutece.portal.service.file.IFileRBACServicegetFileRBACService()get the FileRBACServiceInputStreamgetInputStream(String strKey)StringgetName()booleanhealthCheck()booleanisDefault()voidsetDefault(boolean bDefault)voidsetDownloadUrlService(fr.paris.lutece.portal.service.file.IFileDownloadUrlService downloadUrlService)Sets the downloadServicevoidsetFileRBACService(fr.paris.lutece.portal.service.file.IFileRBACService fileRBACService)set the FileRBACServicevoidsetName(String strName)StringstoreBytes(byte[] blob)StringstoreFile(fr.paris.lutece.portal.business.file.File file)StringstoreFileItem(org.apache.commons.fileupload.FileItem fileItem)StringstoreInputStream(InputStream inputStream)
-
-
-
Constructor Detail
-
S3StorageFileService
public S3StorageFileService(fr.paris.lutece.portal.service.file.IFileDownloadUrlService _fileDownloadUrlService, fr.paris.lutece.portal.service.file.IFileRBACService _fileRBACService, String s3Url, String s3Bucket, String s3Key, String s3Password, String s3DefaultFilePath, String s3ForcePathStyle, String s3Region, String s3ChecksumAlgorithm, String s3ProxyHost, String s3ProxyUsername, String s3ProxyPassword, String s3RequestTimeout, String s3ConnectionTimeout)init- Parameters:
_fileDownloadUrlService-_fileRBACService-s3Url- : the URL of the S3 servers3Bucket- : the name of the S3 buckets3Key- : the key to access the S3 buckets3Password- : the password to access the S3 bucket
-
-
Method Detail
-
getFileRBACService
public fr.paris.lutece.portal.service.file.IFileRBACService getFileRBACService()
get the FileRBACService- Returns:
- the FileRBACService
-
setFileRBACService
public void setFileRBACService(fr.paris.lutece.portal.service.file.IFileRBACService fileRBACService)
set the FileRBACService- Parameters:
fileRBACService-
-
getDownloadUrlService
public fr.paris.lutece.portal.service.file.IFileDownloadUrlService getDownloadUrlService()
Get the downloadService- Returns:
- the downloadService
-
setDownloadUrlService
public void setDownloadUrlService(fr.paris.lutece.portal.service.file.IFileDownloadUrlService downloadUrlService)
Sets the downloadService- Parameters:
downloadUrlService- downloadService
-
getName
public String getName()
- Specified by:
getNamein interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider
-
delete
public void delete(String strPath) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
deletein interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
getFile
public fr.paris.lutece.portal.business.file.File getFile(String strPath) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
getFilein interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
getFileMetaData
public fr.paris.lutece.portal.business.file.File getFileMetaData(String strPath) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
getFileMetaDatain interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
getFile
public fr.paris.lutece.portal.business.file.File getFile(String strPath, boolean withPhysicalFile) throws fr.paris.lutece.portal.service.file.FileServiceException
get file from database- Parameters:
strKey-withPhysicalFile-- Returns:
- the file with the physical file content if withPhysicalFile is true, null otherwise
- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
storeBytes
public String storeBytes(byte[] blob) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
storeBytesin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
storeInputStream
public String storeInputStream(InputStream inputStream) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
storeInputStreamin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
storeFileItem
public String storeFileItem(org.apache.commons.fileupload.FileItem fileItem) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
storeFileItemin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
storeFile
public String storeFile(fr.paris.lutece.portal.business.file.File file) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
storeFilein interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
setDefault
public void setDefault(boolean bDefault)
-
setName
public void setName(String strName)
-
isDefault
public boolean isDefault()
- Specified by:
isDefaultin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider
-
getInputStream
public InputStream getInputStream(String strKey) throws fr.paris.lutece.portal.service.file.FileServiceException
- Specified by:
getInputStreamin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceException
-
getFileDownloadUrlFO
public String getFileDownloadUrlFO(String strKey)
- Specified by:
getFileDownloadUrlFOin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider
-
getFileDownloadUrlFO
public String getFileDownloadUrlFO(String strKey, Map<String,String> additionnalData)
- Specified by:
getFileDownloadUrlFOin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider
-
getFileDownloadUrlBO
public String getFileDownloadUrlBO(String strKey)
- Specified by:
getFileDownloadUrlBOin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider
-
getFileDownloadUrlBO
public String getFileDownloadUrlBO(String strKey, Map<String,String> additionnalData)
- Specified by:
getFileDownloadUrlBOin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider
-
checkAccessRights
public void checkAccessRights(Map<String,String> fileData, fr.paris.lutece.api.user.User user) throws fr.paris.lutece.portal.service.admin.AccessDeniedException, fr.paris.lutece.portal.service.security.UserNotSignedException
- Specified by:
checkAccessRightsin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.admin.AccessDeniedExceptionfr.paris.lutece.portal.service.security.UserNotSignedException
-
checkLinkValidity
public void checkLinkValidity(Map<String,String> fileData) throws fr.paris.lutece.portal.service.file.ExpiredLinkException
- Specified by:
checkLinkValidityin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.ExpiredLinkException
-
getFileFromRequestBO
public fr.paris.lutece.portal.business.file.File getFileFromRequestBO(javax.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.admin.AccessDeniedException, fr.paris.lutece.portal.service.file.ExpiredLinkException, fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.file.FileServiceException- Specified by:
getFileFromRequestBOin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceExceptionfr.paris.lutece.portal.service.admin.AccessDeniedExceptionfr.paris.lutece.portal.service.file.ExpiredLinkExceptionfr.paris.lutece.portal.service.security.UserNotSignedException
-
getFileFromRequestFO
public fr.paris.lutece.portal.business.file.File getFileFromRequestFO(javax.servlet.http.HttpServletRequest request) throws fr.paris.lutece.portal.service.admin.AccessDeniedException, fr.paris.lutece.portal.service.file.ExpiredLinkException, fr.paris.lutece.portal.service.security.UserNotSignedException, fr.paris.lutece.portal.service.file.FileServiceException- Specified by:
getFileFromRequestFOin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider- Throws:
fr.paris.lutece.portal.service.file.FileServiceExceptionfr.paris.lutece.portal.service.admin.AccessDeniedExceptionfr.paris.lutece.portal.service.file.ExpiredLinkExceptionfr.paris.lutece.portal.service.security.UserNotSignedException
-
healthCheck
public boolean healthCheck()
- Specified by:
healthCheckin interfacefr.paris.lutece.portal.service.file.IFileStoreServiceProvider
-
-