Class DefaultMediaStorageConfigService

  • All Implemented Interfaces:
    MediaStorageConfigService

    public class DefaultMediaStorageConfigService
    extends java.lang.Object
    implements MediaStorageConfigService
    Configuration object for media storage. Each MediaFolder object can contain separate configuration.
    Spring Bean ID:
    mediaStorageConfig
    • Constructor Detail

    • Method Detail

      • init

        @PostConstruct
        public void init()
      • isStorageStrategyConfigured

        public boolean isStorageStrategyConfigured​(java.lang.String strategyId)
        Description copied from interface: MediaStorageConfigService
        Checks if particular media storage strategy with strategyId is configured in properties. Storage strategy is considered as configured when it is either set as global strategy or one of media folders has it configured directly.
        Specified by:
        isStorageStrategyConfigured in interface MediaStorageConfigService
        Parameters:
        strategyId - the strategy id
        Returns:
        true, if storage strategy is configured
      • getSecuredFolders

        public java.util.Collection<java.lang.String> getSecuredFolders()
        Description copied from interface: MediaStorageConfigService
        Returns a collection of all secured folders (configured with media.folder.FOLDER_NAME.secured property).
        Specified by:
        getSecuredFolders in interface MediaStorageConfigService
        Returns:
        all secured folders defined in properties
      • getConfigForFolder

        public MediaStorageConfigService.MediaFolderConfig getConfigForFolder​(java.lang.String folderQualifier)
        Description copied from interface: MediaStorageConfigService
        Gets folder configuration for any media folder (not only directly configured in properties) which contains mandatory data like folder qualifier, media storage strategy ID as well information whether folder is secured, is local caching enabled and what is hashing depth. Additionally any configured URL strategies and any attached to folder custom settings are available.

        Method will return also configuration for folders which are not configured directly in properties. In this case service will try to collect required configuration from default settings as well from storage strategy global settings. Keep in mind that this method does not execute any validation against database whether media folder identified by folderQualifier exists.

        Specified by:
        getConfigForFolder in interface MediaStorageConfigService
        Parameters:
        folderQualifier - the folder qualifier
        Returns:
        configuration for folder
      • getFolderConfigsForStrategy

        public java.util.Set<MediaStorageConfigService.MediaFolderConfig> getFolderConfigsForStrategy​(java.lang.String strategyId)
        Description copied from interface: MediaStorageConfigService
        Gets all folder configurations for strategy identified by strategyId (Spring based). If no folders have been configured directly empty set will be returned.
        Specified by:
        getFolderConfigsForStrategy in interface MediaStorageConfigService
        Parameters:
        strategyId - the strategy Spring Bean id
        Returns:
        set of MediaFolderConfig objects containing folder configuration or empty set when storage strategy does not have any directly configured folders.