Package org.intermine.web.struts
Class ResourceFinder
- java.lang.Object
-
- org.intermine.web.struts.ResourceFinder
-
- All Implemented Interfaces:
ResourceOpener
public class ResourceFinder extends java.lang.Object implements ResourceOpener
A class for finding resources in the WEB-INF directory at run-time based on patterns. The purpose of this is to allow resources, particularly configuration files to be found and used by giving them a name with a certain pattern, or by placing them in a certain directory.- Author:
- Alex Kalderimis
-
-
Constructor Summary
Constructors Constructor Description ResourceFinder(javax.servlet.ServletContext context)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<java.lang.String>
findResourcesMatching(java.util.regex.Pattern pattern)
Find all resources matching a pattern in the WEB-INF directory.java.io.InputStream
openResource(java.lang.String resourceName)
Open a resource by name, and return an InputStream to it.
-
-
-
Method Detail
-
openResource
public java.io.InputStream openResource(java.lang.String resourceName)
Description copied from interface:ResourceOpener
Open a resource by name, and return an InputStream to it.- Specified by:
openResource
in interfaceResourceOpener
- Parameters:
resourceName
- The name of the resource.- Returns:
- The open input stream.
-
findResourcesMatching
public java.util.Collection<java.lang.String> findResourcesMatching(java.util.regex.Pattern pattern)
Find all resources matching a pattern in the WEB-INF directory.- Parameters:
pattern
- The pattern to match.- Returns:
- A collection of resource names.
-
-