Class VirtualFileSystem
java.lang.Object
org.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.provider.AbstractFileSystem
org.apache.commons.vfs2.impl.VirtualFileSystem
- All Implemented Interfaces:
Closeable,AutoCloseable,FileSystem,VfsComponent
A logical file system, made up of set of junctions, or links, to files from other file systems.
TODO - Handle nested junctions.
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualFileSystem(AbstractFileName rootFileName, FileSystemOptions fileSystemOptions) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCapabilities(Collection<Capability> caps) Adds the capabilities of this file system.voidaddJunction(String junctionPoint, FileObject targetFile) Adds a junction to this file system.voidclose()Closes this component.protected FileObjectcreateFile(AbstractFileName name) Creates a file object.voidremoveJunction(String junctionPoint) Removes a junction from this file system.Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
addListener, closeCommunicationLink, decorateFileObject, doCloseCommunicationLink, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileFromCache, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, init, isOpen, isReleaseable, notifyAllStreamsClosed, putFileToCache, removeFileFromCache, removeListener, replicateFile, resolveFile, resolveFile, setAttributeMethods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
Constructor Details
-
VirtualFileSystem
Constructs a new instance.- Parameters:
rootFileName- The root file name of this file system.fileSystemOptions- Options to build this file system.
-
-
Method Details
-
addCapabilities
Adds the capabilities of this file system.- Specified by:
addCapabilitiesin classAbstractFileSystem- Parameters:
caps- collections of Capabilities, can be immutable.
-
addJunction
Adds a junction to this file system.- Specified by:
addJunctionin interfaceFileSystem- Overrides:
addJunctionin classAbstractFileSystem- Parameters:
junctionPoint- The location of the junction.targetFile- The target file to base the junction on.- Throws:
FileSystemException- if an error occurs.
-
close
Description copied from class:AbstractFileSystemCloses this component.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceVfsComponent- Overrides:
closein classAbstractFileSystem
-
createFile
Creates 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:
Exception- might throw an Exception, which is then wrapped in FileSystemException.
-
removeJunction
Removes a junction from this file system.- Specified by:
removeJunctionin interfaceFileSystem- Overrides:
removeJunctionin classAbstractFileSystem- Parameters:
junctionPoint- The junction to remove.- Throws:
FileSystemException- if an error occurs.
-