Class S3ProtocolResolverRegistrar

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class S3ProtocolResolverRegistrar
    extends java.lang.Object
    implements org.springframework.context.ApplicationContextAware
    A class which takes an instance of 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.
    Since:
    4.0.0
    • Constructor Detail

      • S3ProtocolResolverRegistrar

        public S3ProtocolResolverRegistrar​(S3ProtocolResolver s3ProtocolResolver)
        Constructor.
        Parameters:
        s3ProtocolResolver - the resolver that this class will register with the application context
    • Method Detail

      • setApplicationContext

        public 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.

        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException