Package net.shibboleth.shared.spring.resource

# Class PreferFileSystemResourceLoader

java.lang.Object
org.springframework.core.io.DefaultResourceLoader
net.shibboleth.shared.spring.resource.PreferFileSystemResourceLoader

All Implemented Interfaces:
  `ResourceLoader`

public class PreferFileSystemResourceLoader extends DefaultResourceLoader
An extension of `DefaultResourceLoader` that (1) is biased in favor of the filesystem such that bare resource paths are assumed to be files rather than classpath resources and (2) supports loading "classpath*:" resources.

## Nested Class Summary

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

`DefaultResourceLoader.ClassPathContextResource`

## Field Summary

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

`CLASSPATH_URL_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`PreferFileSystemResourceLoader()`

## Method Summary

Modifier and Type
Method
Description
`Resource`
`getResource(String location)`
`protected Resource`
`getResourceByPath(String path)`

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

`addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResourceCache, setClassLoader`

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

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

## Constructor Details

### PreferFileSystemResourceLoader

public PreferFileSystemResourceLoader()

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

### getResource

@Nonnull public Resource getResource(@Nonnull String location)

Supports wildcard classpath locations prefixed with `ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX`.

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