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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVirtualFileSystem(AbstractFileName rootName, FileSystemOptions fileSystemOptions) -
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.private FileNamegetJunctionForFile(FileName name) Locates the junction point for the junction containing the given file.voidremoveJunction(String junctionPoint) Removes a junction from this file system.Methods inherited from class 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 AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
Field Details
-
junctions
-
-
Constructor Details
-
VirtualFileSystem
-
-
Method Details
-
addCapabilities
Adds the capabilities of this file system.- Specified by:
addCapabilitiesin classAbstractFileSystem- Parameters:
caps- collections of Capabilities, can be immutable.
-
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.
-
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.
-
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.
-
getJunctionForFile
-
close
public void close()Description copied from class:AbstractFileSystemCloses this component.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceVfsComponent- Overrides:
closein classAbstractFileSystem
-