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:
FileSystemContext, JarContext

public abstract class AbstractVFSContext
extends java.lang.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(java.net.URI rootURI)
          Create a new AbstractVFSContext.
protected AbstractVFSContext(java.net.URL rootURL)
          Create a new AbstractVFSContext.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 VirtualFileHandler findChild(VirtualFileHandler parent, java.lang.String path)
          Find a child
 java.util.List<VirtualFileHandler> getChildren(VirtualFileHandler parent, boolean ignoreErrors)
          Get the children
 java.util.Map<java.lang.String,java.lang.String> getOptions()
          Get the context option settings
 java.net.URI getRootURI()
          Get the root uri
 VFS getVFS()
          Get the VFS for this context
 int hashCode()
           
 java.lang.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.
 
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(java.net.URI rootURI)
Create a new AbstractVFSContext.

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

AbstractVFSContext

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

Parameters:
rootURL - the root url
Throws:
java.net.URISyntaxException
java.lang.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 java.net.URI getRootURI()
Description copied from interface: VFSContext
Get the root uri

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

getOptions

public java.util.Map<java.lang.String,java.lang.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 java.util.List<VirtualFileHandler> getChildren(VirtualFileHandler parent,
                                                      boolean ignoreErrors)
                                               throws java.io.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:
java.io.IOException - for any problem accessing the VFS

findChild

public VirtualFileHandler findChild(VirtualFileHandler parent,
                                    java.lang.String path)
                             throws java.io.IOException
Description copied from interface: VFSContext
Find a child

Specified by:
findChild in interface VFSContext
Parameters:
parent - the parent
path - the path
Returns:
the child
Throws:
java.io.IOException - for any problem accessing the VFS

visit

public void visit(VirtualFileHandler handler,
                  VirtualFileHandlerVisitor visitor)
           throws java.io.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:
java.io.IOException - for any error

visit

protected void visit(VirtualFileHandler handler,
                     VirtualFileHandlerVisitor visitor,
                     boolean includeRoot,
                     boolean leavesOnly,
                     boolean ignoreErrors,
                     boolean includeHidden,
                     VirtualFileFilter recurseFilter)
              throws java.io.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:
java.io.IOException - for any problem accessing the virtual file system

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object