|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.crsh.vfs.spi.AbstractFSDriver<String> org.crsh.vfs.spi.servlet.ServletContextDriver
public class ServletContextDriver
Field Summary | |
---|---|
private ServletContext |
ctx
. |
(package private) static Pattern |
pathPattern
A valid path. |
private String |
root
. |
Constructor Summary | |
---|---|
ServletContextDriver(ServletContext ctx,
String root)
|
Method Summary | |
---|---|
private Matcher |
assertMatch(String path)
|
Iterable<String> |
children(String parent)
Returns an iterable over the children of of a specific directory handle. |
long |
getLastModified(String handle)
Return the last modified date timestamp of an handle. |
boolean |
isDir(String file)
Returns true if the handle represent a directory. |
String |
name(String file)
Returns the name of the handle. |
Iterator<InputStream> |
open(String handle)
Return an iterator over the resources represented by the specified file handle. |
String |
root()
Returns the root handle. |
URL |
toURL(String file)
The implementation attempts to get an URL that will be valid for the file system first (when the war is usually exploded) and if it is not able, it will delegate to ServletContext#getResource(String) . |
Methods inherited from class org.crsh.vfs.spi.AbstractFSDriver |
---|
child |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final Pattern pathPattern
private final ServletContext ctx
private final String root
Constructor Detail |
---|
public ServletContextDriver(ServletContext ctx, String root)
Method Detail |
---|
public String root() throws IOException
FSDriver
IOException
- any io exceptionpublic String name(String file) throws IOException
FSDriver
file
- the handle
IOException
- any io exceptionpublic boolean isDir(String file) throws IOException
FSDriver
file
- the handle
IOException
- any io exceptionpublic Iterable<String> children(String parent) throws IOException
FSDriver
parent
- the directory handle
IOException
- any io exceptionpublic URL toURL(String file) throws IOException
ServletContext#getResource(String)
.
file
- the file path
IOException
- any io exceptionpublic long getLastModified(String handle) throws IOException
FSDriver
handle
- the handle
IOException
- any io exceptionpublic Iterator<InputStream> open(String handle) throws IOException
FSDriver
handle
- the file handle
IOException
- any io exceptionprivate Matcher assertMatch(String path)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |