org.inria.ns.reflex.modules.io.xmldb
Class XMLDBFileSystem

java.lang.Object
  extended by org.apache.commons.vfs.provider.AbstractVfsComponent
      extended by org.apache.commons.vfs.provider.AbstractFileSystem
          extended by org.inria.ns.reflex.modules.io.xmldb.XMLDBFileSystem
All Implemented Interfaces:
FileSystem, VfsComponent, Unwrappable

public class XMLDBFileSystem
extends AbstractFileSystem
implements FileSystem, Unwrappable

A File System for XML:DB.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.structures.Unwrappable
Unwrappable.Unwrapper
 
Field Summary
 
Fields inherited from interface org.inria.ns.reflex.structures.Unwrappable
UNWRAPPER
 
Constructor Summary
XMLDBFileSystem(FileName rootName, FileObject parentLayer, FileSystemOptions fileSystemOptions)
          Create an XML:DB file system backed by a native XML database.
 
Method Summary
 Database getDatabase()
          Return the XML:DB backed by this file system.
 FileObject resolveFile(FileName name)
          Finds a file in this file system.
 FileObject resolveFile(String nameStr)
          Finds a file in this file system.
 Object unwrap()
          Unwrap the underlying XML:DB database.
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileSystem
addJunction, addListener, close, closeCommunicationLink, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, hasCapability, init, isOpen, isReleaseable, removeJunction, removeListener, replicateFile, setAttribute
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractVfsComponent
setContext, setLogger
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.vfs.FileSystem
addJunction, addListener, getAttribute, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, hasCapability, removeJunction, removeListener, replicateFile, setAttribute
 

Constructor Detail

XMLDBFileSystem

public XMLDBFileSystem(FileName rootName,
                       FileObject parentLayer,
                       FileSystemOptions fileSystemOptions)
Create an XML:DB file system backed by a native XML database. The database must have been previously registered to the database manager. The database is retrieved thanks to the provider name that is part of the URI.

Parameters:
rootName - The name of the root file for this file system.
parentLayer - The parent layer.
fileSystemOptions - The options.
See Also:
DatabaseManager
Method Detail

getDatabase

public Database getDatabase()
Return the XML:DB backed by this file system.

Returns:
The XML:DB delivered by the XML:DB provider.

resolveFile

public FileObject resolveFile(FileName name)
                       throws FileSystemException
Finds a file in this file system. As XML:DB files may vary according their attributes, files are not cached.

Specified by:
resolveFile in interface FileSystem
Overrides:
resolveFile in class AbstractFileSystem
Parameters:
name - The name of the file.
Returns:
An XMLDBFileObject that has the name given.
Throws:
FileSystemException

resolveFile

public FileObject resolveFile(String nameStr)
                       throws FileSystemException
Finds a file in this file system.

Specified by:
resolveFile in interface FileSystem
Overrides:
resolveFile in class AbstractFileSystem
Parameters:
nameStr - The path to resolve.
Returns:
An XMLDBFileObject.
Throws:
FileSystemException

unwrap

public Object unwrap()
Unwrap the underlying XML:DB database.

Specified by:
unwrap in interface Unwrappable
Returns:
The database, that can be cast safely to Database.
See Also:
Unwrappable.unwrap(), getDatabase(), Database