public class S3ProtocolResolverRegistrar
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware
S3ProtocolResolver
and adds it to the Spring ApplicationContext
set of ProtocolResolver
. This class will also search for any existing instances of
SimpleStorageProtocolResolver
within the current protocol resolver set. Since the protocol resolvers are
iterated in the order they're added, due to being backed by LinkedHashMap
, any call to
ResourceLoader.getResource(String)
would always use SimpleStorageProtocolResolver
for S3
resources if it was already in the set before this class is invoked.Constructor and Description |
---|
S3ProtocolResolverRegistrar(S3ProtocolResolver s3ProtocolResolver)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
public S3ProtocolResolverRegistrar(S3ProtocolResolver s3ProtocolResolver)
s3ProtocolResolver
- the resolver that this class will register with the application contextpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
Add the S3ProtocolResolver
to the set of protocol resolvers in the application context. Remove any
instances of SimpleStorageProtocolResolver
.
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException