Class RamFileSystem
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.provider.AbstractFileSystem
-
- org.apache.commons.vfs2.provider.ram.RamFileSystem
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,FileSystem,VfsComponent
public class RamFileSystem extends AbstractFileSystem implements java.io.Serializable
A RAM File System.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRamFileSystem(FileName rootName, FileSystemOptions fileSystemOptions)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCapabilities(java.util.Collection<Capability> caps)Adds the capabilities of this file system.voidattach(RamFileObject ramFileObject)Attaches this instance to the given RamFileObject.voidclose()Close the RAMFileSystem.protected FileObjectcreateFile(AbstractFileName name)Creates a file object.voidimportTree(java.io.File file)Import a Tree.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
addJunction, addListener, closeCommunicationLink, decorateFileObject, doCloseCommunicationLink, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileFromCache, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, init, isOpen, isReleaseable, notifyAllStreamsClosed, putFileToCache, removeFileFromCache, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttribute
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
-
-
-
Constructor Detail
-
RamFileSystem
protected RamFileSystem(FileName rootName, FileSystemOptions fileSystemOptions)
Constructs a new instance.- Parameters:
rootName- The root file name of this file system.fileSystemOptions- Options to build this file system.
-
-
Method Detail
-
addCapabilities
protected void addCapabilities(java.util.Collection<Capability> caps)
Description copied from class:AbstractFileSystemAdds the capabilities of this file system.- Specified by:
addCapabilitiesin classAbstractFileSystem- Parameters:
caps- collections of Capabilities, can be immutable.
-
attach
public void attach(RamFileObject ramFileObject)
Attaches this instance to the given RamFileObject.- Parameters:
ramFileObject- A RAM file object.
-
close
public void close()
Close the RAMFileSystem.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceVfsComponent- Overrides:
closein classAbstractFileSystem
-
createFile
protected FileObject createFile(AbstractFileName name) throws java.lang.Exception
Description copied from class:AbstractFileSystemCreates a file object.This method is called only if the requested file is not cached.
- Specified by:
createFilein classAbstractFileSystem- Parameters:
name- name referencing the new file.- Returns:
- new created FileObject.
- Throws:
java.lang.Exception- might throw an Exception, which is then wrapped in FileSystemException.
-
importTree
public void importTree(java.io.File file) throws FileSystemException
Import a Tree.- Parameters:
file- The File- Throws:
FileSystemException- if an error occurs.
-
-