public abstract class TestContextResourceUtils extends Object
ResourceUtils
,
Resource
,
ClassPathResource
,
FileSystemResource
,
UrlResource
,
ResourceLoader
Modifier and Type | Method and Description |
---|---|
static String[] |
convertToClasspathResourcePaths(Class<?> clazz,
String... paths)
Convert the supplied paths to classpath resource paths.
|
static Resource[] |
convertToResources(ResourceLoader resourceLoader,
String... paths)
Convert the supplied paths to
Resource handles using the given
ResourceLoader . |
public static String[] convertToClasspathResourcePaths(Class<?> clazz, 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, String... paths)
Resource
handles using the given
ResourceLoader
.resourceLoader
- the ResourceLoader
to use to convert the pathspaths
- the paths to be convertedconvertToClasspathResourcePaths(java.lang.Class<?>, java.lang.String...)