org.apache.commons.vfs.provider.ram
Class RamFileSystem

java.lang.Object
  extended by org.apache.commons.vfs.provider.AbstractVfsComponent
      extended by org.apache.commons.vfs.provider.AbstractFileSystem
          extended by org.apache.commons.vfs.provider.ram.RamFileSystem
All Implemented Interfaces:
java.io.Serializable, FileSystem, VfsComponent

public class RamFileSystem
extends AbstractFileSystem
implements java.io.Serializable

A RAM File System

See Also:
Serialized Form

Field Summary
private  java.util.Map cache
          Cache of RAM File Data
 
Constructor Summary
protected RamFileSystem(FileName rootName, FileSystemOptions fileSystemOptions)
           
 
Method Summary
protected  void addCapabilities(java.util.Collection caps)
          Adds the capabilities of this file system.
 void attach(RamFileObject fo)
           
 void close()
          Close the RAMFileSystem
protected  FileObject createFile(FileName name)
          Creates a file object.
(package private)  void delete(RamFileObject file)
          Delete a file
 void importTree(java.io.File file)
          Import a Tree
(package private)  java.lang.String[] listChildren(FileName name)
           
(package private)  void rename(RamFileObject from, RamFileObject to)
           
(package private)  void save(RamFileObject file)
          Saves a file
(package private)  int size()
           
(package private)  void toRamFileObject(FileObject fo, FileObject root)
          Import the given file with the name relative to the given root
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileSystem
addJunction, addListener, closeCommunicationLink, decorateFileObject, doCloseCommunicationLink, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileFromCache, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, hasCapability, init, isOpen, isReleaseable, notifyAllStreamsClosed, putFileToCache, removeFileFromCache, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttribute
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

private java.util.Map cache
Cache of RAM File Data

Constructor Detail

RamFileSystem

protected RamFileSystem(FileName rootName,
                        FileSystemOptions fileSystemOptions)
Parameters:
rootName -
fileSystemOptions -
Method Detail

createFile

protected FileObject createFile(FileName name)
                         throws java.lang.Exception
Description copied from class: AbstractFileSystem
Creates a file object. This method is called only if the requested file is not cached.

Specified by:
createFile in class AbstractFileSystem
Throws:
java.lang.Exception

addCapabilities

protected void addCapabilities(java.util.Collection caps)
Description copied from class: AbstractFileSystem
Adds the capabilities of this file system.

Specified by:
addCapabilities in class AbstractFileSystem

listChildren

java.lang.String[] listChildren(FileName name)
Parameters:
name -
Returns:
children

delete

void delete(RamFileObject file)
      throws FileSystemException
Delete a file

Parameters:
file -
Throws:
FileSystemException

save

void save(RamFileObject file)
    throws FileSystemException
Saves a file

Parameters:
file -
Throws:
FileSystemException

rename

void rename(RamFileObject from,
            RamFileObject to)
      throws FileSystemException
Parameters:
from -
to -
Throws:
FileSystemException

attach

public void attach(RamFileObject fo)

importTree

public void importTree(java.io.File file)
                throws FileSystemException
Import a Tree

Parameters:
file -
Throws:
FileSystemException

toRamFileObject

void toRamFileObject(FileObject fo,
                     FileObject root)
               throws FileSystemException
Import the given file with the name relative to the given root

Parameters:
fo -
root -
Throws:
FileSystemException

size

int size()
Returns:
Returns the size of the FileSystem

close

public void close()
Close the RAMFileSystem

Specified by:
close in interface VfsComponent
Overrides:
close in class AbstractFileSystem