public abstract class AbstractBlobStore<T extends ConfigurationProfile> extends Object implements BlobStore
BlobStore
Modifier and Type | Class and Description |
---|---|
static class |
AbstractBlobStore.Mapping
Internal class used when loading the configuration
|
Modifier and Type | Field and Description |
---|---|
protected String |
id
The id of the store
|
protected Map<String,AbstractBlobStore.Mapping> |
mappings
The mappings for the different environments
|
protected String |
pattern
The regex to check for compatible paths
|
protected T |
profile
The profile to connect to the remote store
|
protected ConfigurationMapper<T> |
profileMapper
The mapper to load the profile configuration
|
protected PublishingTargetResolver |
publishingTargetResolver
The publishing target resolver
|
CONFIG_KEY_CONFIGURATION, CONFIG_KEY_ID, CONFIG_KEY_MAPPING, CONFIG_KEY_MAPPING_PREFIX, CONFIG_KEY_MAPPING_PUBLISHING_TARGET, CONFIG_KEY_MAPPING_STORE_TARGET, CONFIG_KEY_PATTERN
Constructor and Description |
---|
AbstractBlobStore() |
Modifier and Type | Method and Description |
---|---|
protected abstract org.springframework.core.io.Resource |
doGetContent(AbstractBlobStore.Mapping mapping,
String path) |
protected abstract void |
doInit(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config) |
String |
getId()
Returns the unique id of the store
|
protected AbstractBlobStore.Mapping |
getMapping(String publishingTarget) |
org.springframework.core.io.Resource |
getResource(String path,
Blob blob)
Resolves the given blob to a readable resource
|
void |
init(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config)
Performs all setup needed with the given configuration
|
boolean |
isCompatible(String path)
Indicates if the given path is compatible with the store
|
void |
setId(String id) |
void |
setPattern(String pattern) |
void |
setProfileMapper(ConfigurationMapper<T> profileMapper) |
void |
setPublishingTargetResolver(PublishingTargetResolver publishingTargetResolver) |
protected String id
protected String pattern
protected Map<String,AbstractBlobStore.Mapping> mappings
protected T extends ConfigurationProfile profile
protected ConfigurationMapper<T extends ConfigurationProfile> profileMapper
protected PublishingTargetResolver publishingTargetResolver
public String getId()
BlobStore
public void setId(String id)
public void setPattern(String pattern)
public void setProfileMapper(ConfigurationMapper<T> profileMapper)
public void setPublishingTargetResolver(PublishingTargetResolver publishingTargetResolver)
public boolean isCompatible(String path)
BlobStore
isCompatible
in interface BlobStore
path
- path to checkpublic void init(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config) throws ConfigurationException
BlobStore
init
in interface BlobStore
config
- the configuration objectConfigurationException
- is any error occursprotected abstract void doInit(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config) throws ConfigurationException
ConfigurationException
public org.springframework.core.io.Resource getResource(String path, Blob blob)
BlobStore
getResource
in interface BlobStore
path
- the path of the resourceblob
- the blob fileprotected abstract org.springframework.core.io.Resource doGetContent(AbstractBlobStore.Mapping mapping, String path)
protected AbstractBlobStore.Mapping getMapping(String publishingTarget)
Copyright © 2023 CrafterCMS. All rights reserved.