org.jboss.virtual.plugins.registry
Class DefaultVFSRegistry

java.lang.Object
  extended by org.jboss.virtual.spi.registry.VFSRegistry
      extended by org.jboss.virtual.plugins.registry.DefaultVFSRegistry

public class DefaultVFSRegistry
extends VFSRegistry

Default vfs registry.

Author:
Ales Justin

Constructor Summary
DefaultVFSRegistry()
           
 
Method Summary
 void addContext(VFSContext context)
          Add new vfs context.
protected  VirtualFileHandler findHandler(VirtualFileHandler root, String path, boolean allowNotFound)
          Find the handler.
protected  VFSCache getCache()
          Get vfs cache.
 VirtualFile getFile(URI uri)
          Get the file.
 VirtualFile getFile(URL url)
          Get the file.
protected  boolean isCacheable(VFSContext context)
          Is the vfs context cacheable.
 void removeContext(VFSContext context)
          Remove the context.
 
Methods inherited from class org.jboss.virtual.spi.registry.VFSRegistry
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultVFSRegistry

public DefaultVFSRegistry()
Method Detail

getCache

protected VFSCache getCache()
Get vfs cache.

Returns:
the vfs cache

isCacheable

protected boolean isCacheable(VFSContext context)
Is the vfs context cacheable.

Parameters:
context - the vfs context
Returns:
true if context is cacheable, false otherwise

addContext

public void addContext(VFSContext context)
Description copied from class: VFSRegistry
Add new vfs context.

Specified by:
addContext in class VFSRegistry
Parameters:
context - the context

removeContext

public void removeContext(VFSContext context)
Description copied from class: VFSRegistry
Remove the context.

Specified by:
removeContext in class VFSRegistry
Parameters:
context - the context

getFile

public VirtualFile getFile(URI uri)
                    throws IOException
Description copied from class: VFSRegistry
Get the file. Check the cache for cached entry, return null if no matching entry exists.

Specified by:
getFile in class VFSRegistry
Parameters:
uri - the file's uri
Returns:
virtual file instance or null if it doesn't exist in cache
Throws:
IOException - for any error

findHandler

protected VirtualFileHandler findHandler(VirtualFileHandler root,
                                         String path,
                                         boolean allowNotFound)
                                  throws IOException
Find the handler.

Parameters:
root - the root
path - the path
allowNotFound - do we allow not found
Returns:
child handler
Throws:
IOException - for any error

getFile

public VirtualFile getFile(URL url)
                    throws IOException
Description copied from class: VFSRegistry
Get the file. Check the cache for cached entry, return null if no matching entry exists.

Specified by:
getFile in class VFSRegistry
Parameters:
url - the file's url
Returns:
virtual file instance or null if it doesn't exist in cache
Throws:
IOException - for any error


Copyright © 2009 JBoss, A division of Red Hat, Inc. All Rights Reserved.