Class StudioBlobStoreResolverImpl
- java.lang.Object
-
- org.craftercms.commons.file.blob.impl.BlobStoreResolverImpl
-
- org.craftercms.studio.impl.v2.repository.blob.StudioBlobStoreResolverImpl
-
- All Implemented Interfaces:
org.craftercms.commons.file.blob.BlobStoreResolver
,StudioBlobStoreResolver
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class StudioBlobStoreResolverImpl extends org.craftercms.commons.file.blob.impl.BlobStoreResolverImpl implements StudioBlobStoreResolver
Implementation ofStudioBlobStoreResolver
- Since:
- 3.1.6
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.cache.Cache<String,Object>
cache
static String
CACHE_KEY_STORE
protected ConfigurationService
configurationService
protected ContentRepository
contentRepository
protected String[]
interceptedPaths
The patterns of urls that should be handled by blob storesprotected StudioConfiguration
studioConfiguration
-
Constructor Summary
Constructors Constructor Description StudioBlobStoreResolverImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<StudioBlobStore>
getAll(String siteId)
Returns allStudioBlobStore
configured for the given siteprotected StudioBlobStore
getBlobStore(String siteId, String storeId, org.apache.commons.configuration2.HierarchicalConfiguration config)
org.craftercms.commons.file.blob.BlobStore
getByPaths(String site, String... paths)
Returns the firstStudioBlobStore
compatible with all given paths for the given siteprotected org.apache.commons.configuration2.HierarchicalConfiguration
getConfiguration(String siteId)
protected org.apache.commons.configuration2.HierarchicalConfiguration
getConfiguration(org.craftercms.commons.config.ConfigurationProvider provider)
protected String
getEnvironment()
boolean
isBlob(String site, String path)
Indicates if a given path belongs to a blob storevoid
setCache(com.google.common.cache.Cache<String,Object> cache)
void
setConfigurationService(ConfigurationService configurationService)
void
setContentRepository(ContentRepository contentRepository)
void
setInterceptedPaths(String[] interceptedPaths)
void
setStudioConfiguration(StudioConfiguration studioConfiguration)
-
Methods inherited from class org.craftercms.commons.file.blob.impl.BlobStoreResolverImpl
findStore, findStoreId, getById, getById, setApplicationContext, setConfigModule, setConfigPath, setConfigurationResolver
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.craftercms.studio.api.v2.repository.blob.StudioBlobStoreResolver
getById
-
-
-
-
Field Detail
-
CACHE_KEY_STORE
public static final String CACHE_KEY_STORE
- See Also:
- Constant Field Values
-
contentRepository
protected ContentRepository contentRepository
-
configurationService
protected ConfigurationService configurationService
-
studioConfiguration
protected StudioConfiguration studioConfiguration
-
interceptedPaths
protected String[] interceptedPaths
The patterns of urls that should be handled by blob stores
-
-
Method Detail
-
setContentRepository
public void setContentRepository(ContentRepository contentRepository)
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
setStudioConfiguration
public void setStudioConfiguration(StudioConfiguration studioConfiguration)
-
setInterceptedPaths
public void setInterceptedPaths(String[] interceptedPaths)
-
getConfiguration
protected org.apache.commons.configuration2.HierarchicalConfiguration getConfiguration(org.craftercms.commons.config.ConfigurationProvider provider) throws org.craftercms.commons.config.ConfigurationException
- Overrides:
getConfiguration
in classorg.craftercms.commons.file.blob.impl.BlobStoreResolverImpl
- Throws:
org.craftercms.commons.config.ConfigurationException
-
getConfiguration
protected org.apache.commons.configuration2.HierarchicalConfiguration getConfiguration(String siteId) throws ExecutionException
- Throws:
ExecutionException
-
getBlobStore
protected StudioBlobStore getBlobStore(String siteId, String storeId, org.apache.commons.configuration2.HierarchicalConfiguration config) throws ExecutionException
- Throws:
ExecutionException
-
getAll
public List<StudioBlobStore> getAll(String siteId) throws ServiceLayerException
Description copied from interface:StudioBlobStoreResolver
Returns allStudioBlobStore
configured for the given site- Specified by:
getAll
in interfaceStudioBlobStoreResolver
- Parameters:
siteId
- the id of the site- Returns:
- list of blob stores
- Throws:
ServiceLayerException
-
getByPaths
public org.craftercms.commons.file.blob.BlobStore getByPaths(String site, String... paths) throws ServiceLayerException
Description copied from interface:StudioBlobStoreResolver
Returns the firstStudioBlobStore
compatible with all given paths for the given site- Specified by:
getByPaths
in interfaceStudioBlobStoreResolver
- Parameters:
site
- the id of the sitepaths
- the lists of paths to check- Returns:
- the blob store object
- Throws:
ServiceLayerException
- if there is any error looking up the stores
-
isBlob
public boolean isBlob(String site, String path) throws ServiceLayerException
Description copied from interface:StudioBlobStoreResolver
Indicates if a given path belongs to a blob store- Specified by:
isBlob
in interfaceStudioBlobStoreResolver
- Parameters:
site
- the id of the sitepath
- the path to check- Returns:
- true if there is a matching blob store
- Throws:
ServiceLayerException
- if there is any error looking up the stores
-
getEnvironment
protected String getEnvironment()
-
-