|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.util.ClasspathResourcesUtil
public class ClasspathResourcesUtil
Util to find resources in the classpath (WEB-INF/lib and WEB-INF/classes).
Nested Class Summary | |
---|---|
static interface |
ClasspathResourcesUtil.Filter
Filter for filtering the resources. |
static class |
ClasspathResourcesUtil.PatternFilter
A filter using a regex pattern. |
Constructor Summary | |
---|---|
ClasspathResourcesUtil()
|
Method Summary | |
---|---|
protected static void |
collectFromClasspathString(Collection<String> resources,
String classpath,
ClasspathResourcesUtil.Filter filter)
|
protected static void |
collectFromFileSystem(ClasspathResourcesUtil.Filter filter,
Collection<String> resources)
|
protected static void |
collectFromURLs(Collection<String> resources,
URL[] urls,
ClasspathResourcesUtil.Filter filter)
|
static String[] |
findResources(ClasspathResourcesUtil.Filter filter)
Return a collection containing the resource names which passed the filter. |
static String[] |
findResources(String regex)
Return a collection containing the resource names which match the regular expression. |
static URL |
getResource(String name)
Get the resource using the current class loader. |
static InputStream |
getStream(String name)
|
static InputStream |
getStream(String name,
boolean cache)
Checks last modified and returns the new content if changed and the cache flag is not set to true. |
protected static File |
sanitizeToFile(URL url)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClasspathResourcesUtil()
Method Detail |
---|
public static String[] findResources(String regex)
public static String[] findResources(ClasspathResourcesUtil.Filter filter)
filter
-
protected static void collectFromURLs(Collection<String> resources, URL[] urls, ClasspathResourcesUtil.Filter filter)
protected static void collectFromClasspathString(Collection<String> resources, String classpath, ClasspathResourcesUtil.Filter filter)
protected static void collectFromFileSystem(ClasspathResourcesUtil.Filter filter, Collection<String> resources)
protected static File sanitizeToFile(URL url)
public static InputStream getStream(String name) throws IOException
IOException
public static InputStream getStream(String name, boolean cache) throws IOException
name
-
IOException
public static URL getResource(String name)
name
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |