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:
Closeable
,Serializable
,AutoCloseable
,FileSystem
,VfsComponent
A RAM File System.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RamFileSystem
(FileName rootName, FileSystemOptions fileSystemOptions) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCapabilities
(Collection<Capability> caps) Adds the capabilities of this file system.void
attach
(RamFileObject ramFileObject) Attaches this instance to the given RamFileObject.void
close()
Close the RAMFileSystem.protected FileObject
createFile
(AbstractFileName name) Creates a file object.void
importTree
(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 Details
-
RamFileSystem
Constructs a new instance.- Parameters:
rootName
- The root file name of this file system.fileSystemOptions
- Options to build this file system.
-
-
Method Details
-
addCapabilities
Description copied from class:AbstractFileSystem
Adds the capabilities of this file system.- Specified by:
addCapabilities
in classAbstractFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
attach
Attaches this instance to the given RamFileObject.- Parameters:
ramFileObject
- A RAM file object.
-
close
Close the RAMFileSystem.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceVfsComponent
- Overrides:
close
in classAbstractFileSystem
-
createFile
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 classAbstractFileSystem
- Parameters:
name
- name referencing the new file.- Returns:
- new created FileObject.
- Throws:
Exception
- might throw an Exception, which is then wrapped in FileSystemException.
-
importTree
Import a Tree.- Parameters:
file
- The File- Throws:
FileSystemException
- if an error occurs.
-