Package org.apache.commons.vfs2.impl
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:
FileSystem
,VfsComponent
public class VirtualFileSystem extends AbstractFileSystem
A logical file system, made up of set of junctions, or links, to files from other file systems.TODO - Handle nested junctions.
-
-
Constructor Summary
Constructors Constructor Description VirtualFileSystem(AbstractFileName rootName, FileSystemOptions fileSystemOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCapabilities(java.util.Collection<Capability> caps)
Adds the capabilities of this file system.void
addJunction(java.lang.String junctionPoint, FileObject targetFile)
Adds a junction to this file system.void
close()
Closes this component.protected FileObject
createFile(AbstractFileName name)
Creates a file object.void
removeJunction(java.lang.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, setAttribute
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
-
-
-
Constructor Detail
-
VirtualFileSystem
public VirtualFileSystem(AbstractFileName rootName, FileSystemOptions fileSystemOptions)
-
-
Method Detail
-
addCapabilities
protected void addCapabilities(java.util.Collection<Capability> caps)
Adds the capabilities of this file system.- Specified by:
addCapabilities
in classAbstractFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
createFile
protected FileObject createFile(AbstractFileName name) throws java.lang.Exception
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:
java.lang.Exception
- might throw an Exception, which is then wrapped in FileSystemException.
-
addJunction
public void addJunction(java.lang.String junctionPoint, FileObject targetFile) throws FileSystemException
Adds a junction to this file system.- Specified by:
addJunction
in interfaceFileSystem
- Overrides:
addJunction
in classAbstractFileSystem
- Parameters:
junctionPoint
- The location of the junction.targetFile
- The target file to base the junction on.- Throws:
FileSystemException
- if an error occurs.
-
removeJunction
public void removeJunction(java.lang.String junctionPoint) throws FileSystemException
Removes a junction from this file system.- Specified by:
removeJunction
in interfaceFileSystem
- Overrides:
removeJunction
in classAbstractFileSystem
- Parameters:
junctionPoint
- The junction to remove.- Throws:
FileSystemException
- if an error occurs.
-
close
public void close()
Description copied from class:AbstractFileSystem
Closes this component.- Specified by:
close
in interfaceVfsComponent
- Overrides:
close
in classAbstractFileSystem
-
-