org.crsh.vfs.spi.servlet
Class ServletContextDriver

java.lang.Object
  extended by org.crsh.vfs.spi.AbstractFSDriver<String>
      extended by org.crsh.vfs.spi.servlet.ServletContextDriver
All Implemented Interfaces:
FSDriver<String>

public class ServletContextDriver
extends AbstractFSDriver<String>

Version:
$Revision$
Author:
Julien Viet

Field Summary
private  ServletContext ctx
          .
(package private) static Pattern pathPattern
          A valid path.
 
Constructor Summary
ServletContextDriver(ServletContext ctx)
           
 
Method Summary
 Iterable<String> children(String parent)
           
 boolean isDir(String file)
           
private  Matcher matcher(String path)
           
 String name(String file)
           
 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

pathPattern

static final Pattern pathPattern
A valid path.


ctx

private final ServletContext ctx
.

Constructor Detail

ServletContextDriver

public ServletContextDriver(ServletContext ctx)
Method Detail

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.