org.crsh.vfs.spi.servlet
Class ServletContextDriver
java.lang.Object
org.crsh.vfs.spi.AbstractFSDriver<String>
org.crsh.vfs.spi.servlet.ServletContextDriver
- All Implemented Interfaces:
- FSDriver<String>
-
public class ServletContextDriver
- extends AbstractFSDriver<String>
-
Field Summary |
private javax.servlet.ServletContext |
ctx
. |
(package private) static Pattern |
pathPattern
A valid path. |
private String |
root
. |
Method Summary |
private Matcher |
assertMatch(String path)
|
Iterable<String> |
children(String parent)
|
long |
getLastModified(String handle)
|
boolean |
isDir(String file)
|
String |
name(String file)
|
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) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pathPattern
static final Pattern pathPattern
-
A valid path.
ctx
private final javax.servlet.ServletContext ctx
-
.
root
private final String root
-
.
ServletContextDriver
public ServletContextDriver(javax.servlet.ServletContext ctx,
String root)
root
public String root()
throws IOException
- Description copied from interface:
FSDriver
-
Returns the root handle.
-
- Returns:
- the root handle
- Throws:
IOException
- any io exception
name
public String name(String file)
throws IOException
-
- Throws:
IOException
isDir
public boolean isDir(String file)
throws IOException
-
- Throws:
IOException
children
public Iterable<String> children(String parent)
throws IOException
-
- Throws:
IOException
toURL
public URL toURL(String file)
throws IOException
-
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)
.
-
- Parameters:
file
- the file path
- Returns:
- the URL
- Throws:
IOException
- any io exception
getLastModified
public long getLastModified(String handle)
throws IOException
-
- Throws:
IOException
open
public InputStream open(String handle)
throws IOException
-
- Throws:
IOException
assertMatch
private Matcher assertMatch(String path)
-
Copyright © 2014 eXo Platform SAS. All Rights Reserved.