Class FilesystemGenericApplicationContext

All Implemented Interfaces:
Closeable, AutoCloseable, BeanFactory, HierarchicalBeanFactory, ListableBeanFactory, BeanDefinitionRegistry, ApplicationContext, ApplicationEventPublisher, ConfigurableApplicationContext, Lifecycle, MessageSource, AliasRegistry, EnvironmentCapable, ResourceLoader, ResourcePatternResolver

public class FilesystemGenericApplicationContext extends GenericApplicationContext
An extension of GenericApplicationContext that is biased in favor of the filesystem such that bare resource paths are assumed to be files rather than classpath resources, and supports conditional resources.
  • Constructor Details

    • FilesystemGenericApplicationContext

      public FilesystemGenericApplicationContext()
      Constructor.
    • FilesystemGenericApplicationContext

      public FilesystemGenericApplicationContext(DefaultListableBeanFactory beanFactory)
      Constructor.
      Parameters:
      beanFactory - bean factory
    • FilesystemGenericApplicationContext

      public FilesystemGenericApplicationContext(ApplicationContext parent)
      Constructor.
      Parameters:
      parent - parent context
    • FilesystemGenericApplicationContext

      public FilesystemGenericApplicationContext(DefaultListableBeanFactory beanFactory, ApplicationContext parent)
      Constructor.
      Parameters:
      beanFactory - bean factory
      parent - parent context
  • Method Details

    • getResourceByPath

      @Nonnull protected Resource getResourceByPath(@Nonnull String path)

      Overrides the standard behavior of path-only resources and treats them as file paths if the path exists. Note that this differs from the ordinary Spring contexts that default to file paths because paths are treated as absolute if they are in fact absolute.

      Overrides:
      getResourceByPath in class DefaultResourceLoader