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 List<org.springframework.core.io.Resource> |
convertToResourceList(org.springframework.core.io.ResourceLoader resourceLoader,
String... paths)
Convert the supplied paths to a list of
Resource handles using
the given ResourceLoader. |
static org.springframework.core.io.Resource[] |
convertToResources(org.springframework.core.io.ResourceLoader resourceLoader,
String... paths)
Convert the supplied paths to an array of
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 org.springframework.core.io.Resource[] convertToResources(org.springframework.core.io.ResourceLoader resourceLoader,
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 List<org.springframework.core.io.Resource> convertToResourceList(org.springframework.core.io.ResourceLoader resourceLoader, 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...)