Class BlobStoreFileStorageService

  • All Implemented Interfaces:
    fr.paris.lutece.portal.service.file.IFileStoreServiceProvider, java.io.Serializable

    public class BlobStoreFileStorageService
    extends java.lang.Object
    implements fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
    DatabaseBlobStoreService.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BlobStoreFileStorageService​(fr.paris.lutece.portal.service.file.IFileDownloadUrlService fileDownloadUrlService, fr.paris.lutece.portal.service.file.IFileRBACService fileRBACService, fr.paris.lutece.plugins.blobstore.service.IBlobStoreService blobStoreService)
      init
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkAccessRights​(java.util.Map<java.lang.String,​java.lang.String> fileData, fr.paris.lutece.api.user.User user)
      void checkLinkValidity​(java.util.Map<java.lang.String,​java.lang.String> fileData)
      void delete​(java.lang.String strKey)
      fr.paris.lutece.portal.service.file.IFileDownloadUrlService getDownloadUrlService()
      Get the downloadService
      fr.paris.lutece.portal.business.file.File getFile​(java.lang.String strKey)
      fr.paris.lutece.portal.business.file.File getFile​(java.lang.String strKey, boolean withPhysicalFile)
      get file from database
      java.lang.String getFileDownloadUrlBO​(java.lang.String strKey)
      java.lang.String getFileDownloadUrlBO​(java.lang.String strKey, java.util.Map<java.lang.String,​java.lang.String> additionnalData)
      java.lang.String getFileDownloadUrlFO​(java.lang.String strKey)
      java.lang.String getFileDownloadUrlFO​(java.lang.String strKey, java.util.Map<java.lang.String,​java.lang.String> additionnalData)
      fr.paris.lutece.portal.business.file.File getFileFromRequestBO​(javax.servlet.http.HttpServletRequest request)
      fr.paris.lutece.portal.business.file.File getFileFromRequestFO​(javax.servlet.http.HttpServletRequest request)
      fr.paris.lutece.portal.business.file.File getFileMetaData​(java.lang.String strKey)
      fr.paris.lutece.portal.service.file.IFileRBACService getFileRBACService()
      get the FileRBACService
      java.io.InputStream getInputStream​(java.lang.String strKey)
      java.lang.String getName()
      boolean isDefault()
      void setDefault​(boolean bDefault)  
      void setDownloadUrlService​(fr.paris.lutece.portal.service.file.IFileDownloadUrlService downloadUrlService)
      Sets the downloadService
      void setFileRBACService​(fr.paris.lutece.portal.service.file.IFileRBACService fileRBACService)
      set the FileRBACService
      java.lang.String storeBytes​(byte[] blob)
      java.lang.String storeFile​(fr.paris.lutece.portal.business.file.File file)
      java.lang.String storeFileItem​(org.apache.commons.fileupload.FileItem fileItem)
      java.lang.String storeInputStream​(java.io.InputStream inputStream)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider

        healthCheck
    • Constructor Detail

      • BlobStoreFileStorageService

        public BlobStoreFileStorageService​(fr.paris.lutece.portal.service.file.IFileDownloadUrlService fileDownloadUrlService,
                                           fr.paris.lutece.portal.service.file.IFileRBACService fileRBACService,
                                           fr.paris.lutece.plugins.blobstore.service.IBlobStoreService blobStoreService)
        init
        Parameters:
        fileDownloadUrlService -
        fileRBACService -
        blobStoreService -
    • 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 java.lang.String getName()
        Specified by:
        getName in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • delete

        public void delete​(java.lang.String strKey)
        Specified by:
        delete in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getFile

        public fr.paris.lutece.portal.business.file.File getFile​(java.lang.String strKey)
        Specified by:
        getFile in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getFileMetaData

        public fr.paris.lutece.portal.business.file.File getFileMetaData​(java.lang.String strKey)
        Specified by:
        getFileMetaData in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getFile

        public fr.paris.lutece.portal.business.file.File getFile​(java.lang.String strKey,
                                                                 boolean withPhysicalFile)
        get file from database
        Parameters:
        strKey -
        withPhysicalFile -
        Returns:
        the file with the physical file content if withPhysicalFile is true
      • storeBytes

        public java.lang.String storeBytes​(byte[] blob)
        Specified by:
        storeBytes in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • storeInputStream

        public java.lang.String storeInputStream​(java.io.InputStream inputStream)
        Specified by:
        storeInputStream in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • storeFileItem

        public java.lang.String storeFileItem​(org.apache.commons.fileupload.FileItem fileItem)
        Specified by:
        storeFileItem in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • storeFile

        public java.lang.String storeFile​(fr.paris.lutece.portal.business.file.File file)
        Specified by:
        storeFile in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • setDefault

        public void setDefault​(boolean bDefault)
      • isDefault

        public boolean isDefault()
        Specified by:
        isDefault in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getInputStream

        public java.io.InputStream getInputStream​(java.lang.String strKey)
        Specified by:
        getInputStream in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getFileDownloadUrlFO

        public java.lang.String getFileDownloadUrlFO​(java.lang.String strKey)
        Specified by:
        getFileDownloadUrlFO in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getFileDownloadUrlFO

        public java.lang.String getFileDownloadUrlFO​(java.lang.String strKey,
                                                     java.util.Map<java.lang.String,​java.lang.String> additionnalData)
        Specified by:
        getFileDownloadUrlFO in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getFileDownloadUrlBO

        public java.lang.String getFileDownloadUrlBO​(java.lang.String strKey)
        Specified by:
        getFileDownloadUrlBO in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • getFileDownloadUrlBO

        public java.lang.String getFileDownloadUrlBO​(java.lang.String strKey,
                                                     java.util.Map<java.lang.String,​java.lang.String> additionnalData)
        Specified by:
        getFileDownloadUrlBO in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
      • checkAccessRights

        public void checkAccessRights​(java.util.Map<java.lang.String,​java.lang.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:
        checkAccessRights in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
        Throws:
        fr.paris.lutece.portal.service.admin.AccessDeniedException
        fr.paris.lutece.portal.service.security.UserNotSignedException
      • checkLinkValidity

        public void checkLinkValidity​(java.util.Map<java.lang.String,​java.lang.String> fileData)
                               throws fr.paris.lutece.portal.service.file.ExpiredLinkException
        Specified by:
        checkLinkValidity in interface fr.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
        Specified by:
        getFileFromRequestBO in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
        Throws:
        fr.paris.lutece.portal.service.admin.AccessDeniedException
        fr.paris.lutece.portal.service.file.ExpiredLinkException
        fr.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
        Specified by:
        getFileFromRequestFO in interface fr.paris.lutece.portal.service.file.IFileStoreServiceProvider
        Throws:
        fr.paris.lutece.portal.service.admin.AccessDeniedException
        fr.paris.lutece.portal.service.file.ExpiredLinkException
        fr.paris.lutece.portal.service.security.UserNotSignedException