org.apache.commons.vfs2.impl
Class VirtualFileSystem

java.lang.Object
  extended by org.apache.commons.vfs2.provider.AbstractVfsComponent
      extended by org.apache.commons.vfs2.provider.AbstractFileSystem
          extended by 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.

Author:
Commons VFS team
To Do:
Handle nested junctions.

Constructor Summary
VirtualFileSystem(AbstractFileName rootName, FileSystemOptions fileSystemOptions)
           
 
Method Summary
protected  void addCapabilities(Collection<Capability> caps)
          Adds the capabilities of this file system.
 void addJunction(String junctionPoint, FileObject targetFile)
          Adds a junction to this file system.
protected  FileObject createFile(AbstractFileName name)
          Creates a file object.
 void removeJunction(String junctionPoint)
          Removes a junction from this file system.
 
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
addListener, close, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualFileSystem

public VirtualFileSystem(AbstractFileName rootName,
                         FileSystemOptions fileSystemOptions)
Method Detail

addCapabilities

protected void addCapabilities(Collection<Capability> caps)
Adds the capabilities of this file system.

Specified by:
addCapabilities in class AbstractFileSystem

createFile

protected FileObject createFile(AbstractFileName name)
                         throws Exception
Creates a file object. This method is called only if the requested file is not cached.

Specified by:
createFile in class AbstractFileSystem
Throws:
Exception

addJunction

public void addJunction(String junctionPoint,
                        FileObject targetFile)
                 throws FileSystemException
Adds a junction to this file system.

Specified by:
addJunction in interface FileSystem
Overrides:
addJunction in class AbstractFileSystem
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(String junctionPoint)
                    throws FileSystemException
Removes a junction from this file system.

Specified by:
removeJunction in interface FileSystem
Overrides:
removeJunction in class AbstractFileSystem
Parameters:
junctionPoint - The junction to remove.
Throws:
FileSystemException - if an error occurs.


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.