public class ResourceUtils extends java.lang.Object
Constructor and Description |
---|
ResourceUtils() |
Modifier and Type | Method and Description |
---|---|
static Resource |
getFileBackedResource(Resource resource) |
static java.lang.String |
getPackageResourcePath(java.lang.Class<?> contextClass)
Gets the path to resources of given context class (relative to
class-resources folder).
|
static java.util.List<Resource> |
listResources(java.lang.Class<?> contextClass,
java.lang.String path)
Lists all resources in the given path (non-recursive).
|
static java.util.List<Resource> |
listResourcesRecursively(java.lang.Class<?> contextClass,
java.lang.String path)
Lists all resources in the given path (recursively).
|
public ResourceUtils()
public static java.util.List<Resource> listResources(java.lang.Class<?> contextClass, java.lang.String path)
path
- The path to list resources from. An empty string means the root of
the contextClass' package.public static java.util.List<Resource> listResourcesRecursively(java.lang.Class<?> contextClass, java.lang.String path)
path
- The path to list resources from. An empty string means the root of
the contextClass' package.public static java.lang.String getPackageResourcePath(java.lang.Class<?> contextClass)
contextClass
- The class for which path to resources should be returnedpublic static Resource getFileBackedResource(Resource resource)