Package net.shibboleth.idp.profile.spring.factory

# Class FlowRelativeResourceLoader

java.lang.Object
org.springframework.core.io.DefaultResourceLoader
net.shibboleth.idp.profile.spring.factory.FlowRelativeResourceLoader

All Implemented Interfaces:
  `ResourceLoader`

class FlowRelativeResourceLoader extends DefaultResourceLoader
This code is extended from org.springframework.webflow.engine.builder.model.FlowRelativeResourceLoader with modifications to support proper lookup of resources via both filesystem and classpath along with custom protocol-specific loaders. This fills a gap for cases where the Spring `ResourceLoader` itself is fully replaced, versus relying solely on customized behavior in the Spring contexts themselves.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoader

`DefaultResourceLoader.ClassPathContextResource`

## Field Summary

Fields
Modifier and Type
Field
Description
`private Resource`
`flowResource`
Flow resource for relative lookup.

### Fields inherited from interface org.springframework.core.io.ResourceLoader

`CLASSPATH_URL_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`FlowRelativeResourceLoader(Resource resource)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`private Resource`
`createFlowRelativeResource(String location)`
Return resource relative to the flowResource.
`ClassLoader`
`getClassLoader()`
`Resource`
`getResource(String location)`
`protected Resource`
`getResourceByPath(String path)`

### Methods inherited from class org.springframework.core.io.DefaultResourceLoader

`addProtocolResolver, clearResourceCaches, getProtocolResolvers, getResourceCache, setClassLoader`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### flowResource

@Nonnull private Resource flowResource
Flow resource for relative lookup.

## Constructor Details

### FlowRelativeResourceLoader

public FlowRelativeResourceLoader(@Nonnull Resource resource)
Constructor.

Parameters:
  `resource` - flow resource for relative lookup

## Method Details

### getClassLoader

public ClassLoader getClassLoader()

Specified by:
  `getClassLoader` in interface `ResourceLoader`
Overrides:
  `getClassLoader` in class `DefaultResourceLoader`

### getResource

@Nonnull public Resource getResource(@Nonnull String location)

Specified by:
  `getResource` in interface `ResourceLoader`
Overrides:
  `getResource` in class `DefaultResourceLoader`

### createFlowRelativeResource

@Nonnull private Resource createFlowRelativeResource(@Nonnull String location)
Return resource relative to the flowResource.

Parameters:
  `location` - the resource location
Returns:
  a corresponding Resource handle

### 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`