public class ServletContextDriver extends AbstractFSDriver<String>
| Modifier and Type | Field and Description |
|---|---|
private ServletContext |
ctx
.
|
(package private) static Pattern |
pathPattern
A valid path.
|
private String |
root
.
|
| Constructor and Description |
|---|
ServletContextDriver(ServletContext ctx,
String root) |
| Modifier and Type | Method and Description |
|---|---|
private Matcher |
assertMatch(String path) |
Iterable<String> |
children(String parent) |
long |
getLastModified(String handle) |
boolean |
isDir(String file) |
String |
name(String file) |
Iterator<InputStream> |
open(String 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). |
childstatic final Pattern pathPattern
private final ServletContext ctx
public ServletContextDriver(ServletContext ctx, String root)
public String root() throws IOException
FSDriverIOException - any io exceptionpublic String name(String file) throws IOException
IOExceptionpublic boolean isDir(String file) throws IOException
IOExceptionpublic Iterable<String> children(String parent) throws IOException
IOExceptionpublic URL toURL(String file) throws IOException
ServletContext#getResource(String).file - the file pathIOException - any io exceptionpublic long getLastModified(String handle) throws IOException
IOExceptionpublic Iterator<InputStream> open(String handle) throws IOException
IOExceptionprivate Matcher assertMatch(String path)
Copyright © 2014 eXo Platform SAS. All Rights Reserved.