|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.spring.configurator.ResourceUtils
public abstract class ResourceUtils
Utility class for Spring resource handling.
Nested Class Summary | |
---|---|
protected static class |
ResourceUtils.ResourceComparator
Class implementing a simple resource comparator as described here: getResourceComparator() . |
Constructor Summary | |
---|---|
ResourceUtils()
|
Method Summary | |
---|---|
protected static String |
correctUri(String uri)
|
static Resource[] |
filterResources(Resource[] resources,
ResourceFilter filter)
|
static Properties |
getPOMProperties(String groupId,
String artifactId)
Return the properties added by Maven. |
static Comparator |
getResourceComparator()
Return a resource comparator. |
static String |
getUri(Resource resource)
Get the uri of a resource. |
static boolean |
isClasspathUri(String uri)
|
static void |
readProperties(String propertiesPath,
Properties properties,
ResourceLoader resourceLoader,
ResourceFilter resourceFilter,
Log logger)
Read all property files from the given directory and apply them to the supplied properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceUtils()
Method Detail |
---|
public static String getUri(Resource resource) throws IOException
resource
- The resource.
IOException
protected static String correctUri(String uri)
public static boolean isClasspathUri(String uri)
public static void readProperties(String propertiesPath, Properties properties, ResourceLoader resourceLoader, ResourceFilter resourceFilter, Log logger)
propertiesPath
- The directory path.properties
- The properties object where all the read properties are applied to.resourceLoader
- The resource loader to load the property files.resourceFilter
- The resource filter used to filter read property files, if null no filtering is being applied.logger
- Optional logger for debugging.public static Comparator getResourceComparator()
public static Properties getPOMProperties(String groupId, String artifactId)
groupId
- The group identifier of the artifact.artifactId
- The artifact identifier.
public static Resource[] filterResources(Resource[] resources, ResourceFilter filter)
resources
- The array of resources need to be filteredfilter
- The instance of the filter itself
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |