Interface IFileStoreServiceProvider

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    LocalDatabaseFileService

    public interface IFileStoreServiceProvider
    extends java.io.Serializable
    File 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
      void checkAccessRights​(java.util.Map<java.lang.String,​java.lang.String> fileData, fr.paris.lutece.api.user.User user)
      check if current user can access the file
      void checkLinkValidity​(java.util.Map<java.lang.String,​java.lang.String> fileData)
      check if link is valid
      void delete​(java.lang.String strKey)
      Delete a blob
      File getFile​(java.lang.String strKey)
      Get a file
      java.lang.String getFileDownloadUrlBO​(java.lang.String strKey)
      Gets the file download url for Back Office admin Lutece users
      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
      java.lang.String getFileDownloadUrlFO​(java.lang.String strKey)
      Gets the file download url for Front Office Lutece users
      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
      File getFileFromRequestBO​(javax.servlet.http.HttpServletRequest request)
      get requested file from BO
      File getFileFromRequestFO​(javax.servlet.http.HttpServletRequest request)
      get requested file from FO
      File getFileMetaData​(java.lang.String strKey)
      Get a file object only filled with the meta data (name, size ...) without the physical file content
      java.io.InputStream getInputStream​(java.lang.String strKey)
      Gets a blob as InputStream
      java.lang.String getName()
      get the service name
      default boolean healthCheck()
      health check
      boolean isDefault()
      get the default
      java.lang.String storeBytes​(byte[] blob)
      Store a blob from a bytes array
      java.lang.String storeFile​(File file)
      Stores a file Lutece File
      java.lang.String storeFileItem​(org.apache.commons.fileupload.FileItem fileItem)
      Stores a org.apache.commons.fileupload.FileItem
      java.lang.String storeInputStream​(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
      • storeFileItem

        java.lang.String storeFileItem​(org.apache.commons.fileupload.FileItem fileItem)
                                throws FileServiceException
        Stores 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 FileServiceException
        Stores an input stream
        Parameters:
        inputStream - the input stream
        Returns:
        The key of the blob
        Throws:
        FileServiceException
      • storeBytes

        java.lang.String storeBytes​(byte[] blob)
                             throws FileServiceException
        Store a blob from a bytes array
        Parameters:
        blob - The blob
        Returns:
        The key of the blob
        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 FileServiceException
        Gets a blob as InputStream
        Parameters:
        strKey - the key
        Returns:
        the InputStream
        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 - the
        additionnalData -
        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 - the
        additionnalData -
        Returns:
        the download link
      • checkLinkValidity

        void checkLinkValidity​(java.util.Map<java.lang.String,​java.lang.String> fileData)
                        throws ExpiredLinkException
        check if link is valid
        Parameters:
        fileData -
        Throws:
        ExpiredLinkException