org.crsh.vfs.spi.file
Class FileDriver

java.lang.Object
  extended by org.crsh.vfs.spi.AbstractFSDriver<File>
      extended by org.crsh.vfs.spi.file.FileDriver
All Implemented Interfaces:
FSDriver<File>

public class FileDriver
extends AbstractFSDriver<File>


Field Summary
private  File root
          .
 
Constructor Summary
FileDriver(File root)
          Create a new file driver.
 
Method Summary
 Iterable<File> children(File handle)
          Returns an iterable over the children of of a specific directory handle.
 long getLastModified(File handle)
          Return the last modified date timestamp of an handle.
 boolean isDir(File handle)
          Returns true if the handle represent a directory.
 String name(File handle)
          Returns the name of the handle.
 Iterator<InputStream> open(File handle)
          Return an iterator over the resources represented by the specified file handle.
 File root()
          Returns the root handle.
 
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

root

private final File root
.

Constructor Detail

FileDriver

public FileDriver(File root)
           throws NullPointerException
Create a new file driver.

Parameters:
root - the root
Throws:
NullPointerException - if the root argument is null
Method Detail

root

public File 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(File handle)
            throws IOException
Description copied from interface: FSDriver
Returns the name of the handle.

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

isDir

public boolean isDir(File handle)
              throws IOException
Description copied from interface: FSDriver
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

children

public Iterable<File> children(File handle)
                        throws IOException
Description copied from interface: FSDriver
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

public long getLastModified(File handle)
                     throws IOException
Description copied from interface: FSDriver
Return the last modified date timestamp of an handle.

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

open

public Iterator<InputStream> open(File handle)
                           throws IOException
Description copied from interface: FSDriver
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.