IMPLEMENTATIONS, USER_IMPLEMENTATIONS
Constructor and Description |
---|
DefaultVFS() |
Modifier and Type | Method and Description |
---|---|
protected URL |
findJarForResource(URL url)
Attempts to deconstruct the given URL to find a JAR file containing the resource referenced
by the URL.
|
protected String |
getPackagePath(String packageName)
Converts a Java package name to a path that can be looked up with a call to
ClassLoader.getResources(String) . |
protected boolean |
isJar(URL url)
Returns true if the resource located at the given URL is a JAR file.
|
protected boolean |
isJar(URL url,
byte[] buffer)
Returns true if the resource located at the given URL is a JAR file.
|
boolean |
isValid()
Return true if the
VFS implementation is valid for the current environment. |
List<String> |
list(URL url,
String path)
Recursively list the full resource path of all the resources that are children of the
resource identified by a URL.
|
protected List<String> |
listResources(JarInputStream jar,
String path)
List the names of the entries in the given
JarInputStream that begin with the
specified path . |
addImplClass, getClass, getInstance, getMethod, getResources, invoke, list
public boolean isValid()
VFS
VFS
implementation is valid for the current environment.public List<String> list(URL url, String path) throws IOException
VFS
list
in class VFS
url
- The URL that identifies the resource to list.path
- The path to the resource that is identified by the URL. Generally, this is the
value passed to VFS.getResources(String)
to get the resource URL.IOException
- If I/O errors occurprotected List<String> listResources(JarInputStream jar, String path) throws IOException
JarInputStream
that begin with the
specified path
. Entries will match with or without a leading slash.jar
- The JAR input streampath
- The leading path to matchIOException
- If I/O errors occurprotected URL findJarForResource(URL url) throws MalformedURLException
url
- The URL of the JAR entry.MalformedURLException
protected String getPackagePath(String packageName)
ClassLoader.getResources(String)
.packageName
- The Java package name to convert to a pathprotected boolean isJar(URL url)
url
- The URL of the resource to test.protected boolean isJar(URL url, byte[] buffer)
url
- The URL of the resource to test.buffer
- A buffer into which the first few bytes of the resource are read. The buffer
must be at least the size of JAR_MAGIC
. (The same buffer may be reused
for multiple calls as an optimization.)Copyright © 2010–2015 MyBatis.org. All rights reserved.