|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ibatis.io.VFS
public abstract class VFS
Provides a very simple API for accessing resources within an application server.
Field Summary | |
---|---|
static Class<?>[] |
IMPLEMENTATIONS
The built-in implementations. |
static List<Class<? extends VFS>> |
USER_IMPLEMENTATIONS
The list to which implementations are added by addImplClass(Class) . |
Constructor Summary | |
---|---|
VFS()
|
Method Summary | ||
---|---|---|
static void |
addImplClass(Class<? extends VFS> clazz)
Adds the specified class to the list of VFS implementations. |
|
protected static Class<?> |
getClass(String className)
Get a class by name. |
|
static VFS |
getInstance()
Get the singleton VFS instance. |
|
protected static Method |
getMethod(Class<?> clazz,
String methodName,
Class<?>... parameterTypes)
Get a method by name and parameter types. |
|
protected static List<URL> |
getResources(String path)
Get a list of URL s from the context classloader for all the resources found at the
specified path. |
|
protected static
|
invoke(Method method,
Object object,
Object... parameters)
Invoke a method on an object and return whatever it returns. |
|
abstract boolean |
isValid()
Return true if the VFS implementation is valid for the current environment. |
|
List<String> |
list(String path)
Recursively list the full resource path of all the resources that are children of all the resources found at the specified path. |
|
protected abstract List<String> |
list(URL url,
String forPath)
Recursively list the full resource path of all the resources that are children of the resource identified by a URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Class<?>[] IMPLEMENTATIONS
public static final List<Class<? extends VFS>> USER_IMPLEMENTATIONS
addImplClass(Class)
.
Constructor Detail |
---|
public VFS()
Method Detail |
---|
public static VFS getInstance()
VFS
instance. If no VFS
implementation can be found for the
current environment, then this method returns null.
public static void addImplClass(Class<? extends VFS> clazz)
VFS
implementations. Classes added in this
manner are tried in the order they are added and before any of the built-in implementations.
clazz
- The VFS
implementation class to add.protected static Class<?> getClass(String className)
protected static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes)
clazz
- The class to which the method belongs.methodName
- The name of the method.parameterTypes
- The types of the parameters accepted by the method.protected static <T> T invoke(Method method, Object object, Object... parameters) throws IOException, RuntimeException
method
- The method to invoke.object
- The instance or class (for static methods) on which to invoke the method.parameters
- The parameters to pass to the method.
IOException
- If I/O errors occur
StripesRuntimeException
- If anything else goes wrong
RuntimeException
protected static List<URL> getResources(String path) throws IOException
URL
s from the context classloader for all the resources found at the
specified path.
path
- The resource path.
URL
s, as returned by ClassLoader.getResources(String)
.
IOException
- If I/O errors occurpublic abstract boolean isValid()
VFS
implementation is valid for the current environment.
protected abstract List<String> list(URL url, String forPath) throws IOException
url
- The URL that identifies the resource to list.forPath
- The path to the resource that is identified by the URL. Generally, this is the
value passed to getResources(String)
to get the resource URL.
IOException
- If I/O errors occurpublic List<String> list(String path) throws IOException
path
- The path of the resource(s) to list.
IOException
- If I/O errors occur
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |