Interface ResourceResolver

All Superinterfaces:
AutoCloseable, CamelContextAware, HasCamelContext, Service, StaticService

public interface ResourceResolver extends StaticService, CamelContextAware
SPI for resolving a Resource for a specific URI scheme.

Each resolver handles a single scheme (such as file, classpath, http) and turns a location into a Resource, or returns null if it cannot. The ResourceLoader dispatches to the matching resolver; scheme-specific resolvers are discovered from "META-INF/services/org/apache/camel/resource-resolver/", with an optional fallback used when no scheme matches.

Since:
3.9
See Also:
  • Field Details

    • FACTORY_PATH

      static final String FACTORY_PATH
      Service factory base path for scheme specific resolver.
      See Also:
    • FALLBACK_RESOURCE_RESOLVER

      static final String FALLBACK_RESOURCE_RESOLVER
      Key for a custom fallback resource resolver.
      See Also:
  • Method Details

    • getSupportedScheme

      String getSupportedScheme()
      The supported resource scheme.

      Implementations should support a single scheme only.

    • resolve

      @Nullable Resource resolve(String location)
      Resolve a Resource from a give uri.
      Parameters:
      location - the location of the resource to resolve.
      Returns:
      an Resource, null if was not possible to resolve the resource.