org.crsh.vfs.spi.ram
Class RAMDriver
java.lang.Object
org.crsh.vfs.spi.AbstractFSDriver<Path>
org.crsh.vfs.spi.ram.RAMDriver
- All Implemented Interfaces:
- FSDriver<Path>
-
public class RAMDriver
- extends AbstractFSDriver<Path>
-
Method Summary |
void |
add(Path path, String file)
|
void |
add(String path, String file)
|
Iterable<Path> |
children(Path handle)
Returns an iterable over the children of of a specific directory handle. |
long |
getLastModified(Path handle)
Return the last modified date timestamp of an handle. |
boolean |
isDir(Path handle)
Returns true if the handle represent a directory. |
String |
name(Path handle)
Returns the name of the handle. |
Iterator<InputStream> |
open(Path handle)
Return an iterator over the resources represented by the specified file handle. |
Path |
root()
Returns the root handle. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
root
private final Path root
-
.
entries
final HashMap<Path,String> entries
-
.
baseURL
URL baseURL
-
.
RAMDriver
public RAMDriver()
add
public void add(String path,
String file)
-
add
public void add(Path path,
String file)
-
root
public Path 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(Path 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(Path 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<Path> children(Path 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(Path 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(Path 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.