org.jboss.virtual.plugins.context
Class AbstractVFSContext

java.lang.Object
  extended by org.jboss.virtual.plugins.context.AbstractVFSContext
All Implemented Interfaces:
VFSContext
Direct Known Subclasses:
AssembledContext, FileSystemContext, JarContext, MemoryContext

public abstract class AbstractVFSContext
extends Object
implements VFSContext

AbstractVFSContext.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Scott.Stark@jboss.org

Field Summary
protected  org.jboss.logging.Logger log
          The log
 
Constructor Summary
protected AbstractVFSContext(URI rootURI)
          Create a new AbstractVFSContext.
protected AbstractVFSContext(URL rootURL)
          Create a new AbstractVFSContext.
 
Method Summary
protected  void addOption(String key, String value)
           
 boolean equals(Object obj)
           
 VirtualFileHandler getChild(VirtualFileHandler parent, String path)
          Get a child
 List<VirtualFileHandler> getChildren(VirtualFileHandler parent, boolean ignoreErrors)
          Get the children
 Map<String,String> getOptions()
          Get the context option settings
 URI getRootURI()
          Get the root uri
 VFS getVFS()
          Get the VFS for this context
 int hashCode()
           
 String toString()
           
 void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor)
          Visit the virtual file system
protected  void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor, boolean includeRoot, boolean leavesOnly, boolean ignoreErrors, boolean includeHidden, VirtualFileFilter recurseFilter)
          Visit. the file system, recursive death checking is left to the visitor or otherwise a stack overflow.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.virtual.spi.VFSContext
getRoot
 

Field Detail

log

protected final org.jboss.logging.Logger log
The log

Constructor Detail

AbstractVFSContext

protected AbstractVFSContext(URI rootURI)
Create a new AbstractVFSContext.

Parameters:
rootURI - the root url
Throws:
IllegalArgumentException - if rootURI is null

AbstractVFSContext

protected AbstractVFSContext(URL rootURL)
                      throws URISyntaxException
Create a new AbstractVFSContext.

Parameters:
rootURL - the root url
Throws:
URISyntaxException - for illegal URL
IllegalArgumentException - if rootURI is null
Method Detail

getVFS

public VFS getVFS()
Description copied from interface: VFSContext
Get the VFS for this context

Specified by:
getVFS in interface VFSContext
Returns:
the vfs

getRootURI

public URI getRootURI()
Description copied from interface: VFSContext
Get the root uri

Specified by:
getRootURI in interface VFSContext
Returns:
the root uri

addOption

protected void addOption(String key,
                         String value)

getOptions

public Map<String,String> getOptions()
Description copied from interface: VFSContext
Get the context option settings

Specified by:
getOptions in interface VFSContext
Returns:
a map of the context options

getChildren

public List<VirtualFileHandler> getChildren(VirtualFileHandler parent,
                                            boolean ignoreErrors)
                                     throws IOException
Description copied from interface: VFSContext
Get the children

Specified by:
getChildren in interface VFSContext
Parameters:
parent - the parent
ignoreErrors - whether to ignore errors
Returns:
the children
Throws:
IOException - for any problem accessing the VFS

getChild

public VirtualFileHandler getChild(VirtualFileHandler parent,
                                   String path)
                            throws IOException
Description copied from interface: VFSContext
Get a child

Specified by:
getChild in interface VFSContext
Parameters:
parent - the parent
path - the path
Returns:
the child or null if not found
Throws:
IOException - for any problem accessing the VFS

visit

public void visit(VirtualFileHandler handler,
                  VirtualFileHandlerVisitor visitor)
           throws IOException
Description copied from interface: VFSContext
Visit the virtual file system

Specified by:
visit in interface VFSContext
Parameters:
handler - the reference handler
visitor - the visitor
Throws:
IOException - for any error

visit

protected void visit(VirtualFileHandler handler,
                     VirtualFileHandlerVisitor visitor,
                     boolean includeRoot,
                     boolean leavesOnly,
                     boolean ignoreErrors,
                     boolean includeHidden,
                     VirtualFileFilter recurseFilter)
              throws IOException
Visit. the file system, recursive death checking is left to the visitor or otherwise a stack overflow.

Parameters:
handler - the reference handler
visitor - the visitor
includeRoot - whether to visit the root
leavesOnly - whether to visit leaves only
ignoreErrors - whether to ignore errors
includeHidden - whether to include hidden files
recurseFilter - the recurse filter
Throws:
IOException - for any problem accessing the virtual file system

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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