public abstract class TestContextResourceUtils
extends java.lang.Object
ResourceUtils
,
Resource
,
ClassPathResource
,
FileSystemResource
,
UrlResource
,
ResourceLoader
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
convertToClasspathResourcePaths(java.lang.Class<?> clazz,
java.lang.String... paths)
Convert the supplied paths to classpath resource paths.
|
static java.util.List<Resource> |
convertToResourceList(ResourceLoader resourceLoader,
java.lang.String... paths)
Convert the supplied paths to a list of
Resource handles using
the given ResourceLoader . |
static Resource[] |
convertToResources(ResourceLoader resourceLoader,
java.lang.String... paths)
Convert the supplied paths to an array of
Resource handles using
the given ResourceLoader . |
public static java.lang.String[] convertToClasspathResourcePaths(java.lang.Class<?> clazz, java.lang.String... paths)
For each of the supplied paths:
"context.xml"
— will
be treated as a classpath resource that is relative to the package in
which the specified class is defined.
"/org/example/schema.sql"
.
classpath:
,
file:
, http:
, etc.) will be
cleaned
but otherwise unmodified.clazz
- the class with which the paths are associatedpaths
- the paths to be convertedconvertToResources(org.springframework.core.io.ResourceLoader, java.lang.String...)
public static Resource[] convertToResources(ResourceLoader resourceLoader, java.lang.String... paths)
Resource
handles using
the given ResourceLoader
.resourceLoader
- the ResourceLoader
to use to convert the pathspaths
- the paths to be convertedconvertToResourceList(ResourceLoader, String...)
,
convertToClasspathResourcePaths(java.lang.Class<?>, java.lang.String...)
public static java.util.List<Resource> convertToResourceList(ResourceLoader resourceLoader, java.lang.String... paths)
Resource
handles using
the given ResourceLoader
.resourceLoader
- the ResourceLoader
to use to convert the pathspaths
- the paths to be convertedconvertToResources(ResourceLoader, String...)
,
convertToClasspathResourcePaths(java.lang.Class<?>, java.lang.String...)