org.crsh.vfs.spi
Interface FSDriver<H>

Type Parameters:
H - the handle generic type.
All Known Implementing Classes:
AbstractFSDriver, FileDriver, RAMDriver, ServletContextDriver, URLDriver

public interface FSDriver<H>

A driver for the file system, this interface is the Service Provider Interface (SPI) part provided by CRaSH.

The driver works with handles which are opaque objects that model a path in the file system, an handle can represent a file or a directory and is considered as non modifiable from the file system perspective.


Method Summary
 H child(H handle, String name)
          Return the specific child of a directory handle, null should be returned if no such child exist.
 Iterable<H> children(H handle)
          Returns an iterable over the children of of a specific directory handle.
 long getLastModified(H handle)
          Return the last modified date timestamp of an handle.
 boolean isDir(H handle)
          Returns true if the handle represent a directory.
 String name(H handle)
          Returns the name of the handle.
 Iterator<InputStream> open(H handle)
          Return an iterator over the resources represented by the specified file handle.
 H root()
          Returns the root handle.
 

Method Detail

root

H root()
       throws IOException
Returns the root handle.

Returns:
the root handle
Throws:
IOException - any io exception

name

String name(H handle)
            throws IOException
Returns the name of the handle.

Parameters:
handle - the handle
Returns:
the handle name
Throws:
IOException - any io exception

isDir

boolean isDir(H handle)
              throws IOException
Returns true if the handle represent a directory.

Parameters:
handle - the handle
Returns:
true if the handle is a directory, false otherwise
Throws:
IOException - any io exception

child

H child(H handle,
        String name)
        throws IOException
Return the specific child of a directory handle, null should be returned if no such child exist.

Parameters:
handle - the directory handle
name - the child name
Returns:
the specified child
Throws:
IOException - any io exception

children

Iterable<H> children(H handle)
                     throws IOException
Returns an iterable over the children of of a specific directory handle.

Parameters:
handle - the directory handle
Returns:
the children as an iterable
Throws:
IOException - any io exception

getLastModified

long getLastModified(H handle)
                     throws IOException
Return the last modified date timestamp of an handle.

Parameters:
handle - the handle
Returns:
the last modified timestamp
Throws:
IOException - any io exception

open

Iterator<InputStream> open(H handle)
                           throws IOException
Return an iterator over the resources represented by the specified file handle.

Parameters:
handle - the file handle
Returns:
the iterator
Throws:
IOException - any io exception


Copyright © 2015 eXo Platform SAS. All Rights Reserved.