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>
- Version:
- $Revision$
- Author:
- Julien Viet
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 ServletContext ctx
- .
ServletContextDriver
public ServletContextDriver(ServletContext ctx)
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
matcher
private Matcher matcher(String path)
Copyright © 2012 eXo Platform SAS. All Rights Reserved.